473,395 Members | 1,738 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Need Assistance Checking the Untraced Error in my VBA and SQL Codes

1
Greetings
I would appreciate your assistance to advise me which error I did in encoding SQL and VBA codes in MS Access (20)10 append table and Form.

I have two tables DataEntry and GeneralJournal. I created SQL criteria in an append query with code copied below to update Credit field in table GeneralJournal with vale of field TransactionValue if value of field TransactionTypeCode in DataEntry is 1100.

This code turns no error but zero record can be copied
Expand|Select|Wrap|Line Numbers
  1. INSERT INTO GeneralJournal ( Credit )
  2. SELECT      DataEntry.TransactionValue
  3. FROM        DataEntry
  4. WHERE       DataEntry.TransactionTypeCode = 1100;
Then I tried to initiate a form to do the same using Afterupdate in the field TransactionValue.

Also this turns the error copied below.
Expand|Select|Wrap|Line Numbers
  1. Private Sub TransactionValue_AfterUpdate()
  2.   If DataEntry.TransactionTypeCode = 1100 Then
  3.     GeneralJournal.Credit = DataEntry.TransactionValue
  4.   Else
  5.     GeneralJournal.Credit = 0
  6.   End If
  7. End Sub
Error:
Problem in connecting MS Access with OLE server or ActiveX control

Please Assist to have it fixed.

Thanks
Sep 28 '17 #1

✓ answered by NeoPa

Your APPEND query seems fine - syntactically at least. If that's not behaving as you expect then something entirely unrelated to anything you've told us is the cause. Usually you get more information from running the query manually as part of a QueryDef than running it from code.

The code is not even a starting point. Sorry, but you cannot simply reference table fields in VBA as if they were an object. Here's something for that (Access VBA DAO Recordset Loop Using Two Recordsets), but I suspect that's not where your focus needs to be just yet.

TBH, I suspect you need to focus on the SQL side. At least first.

1 1455
NeoPa
32,556 Expert Mod 16PB
Your APPEND query seems fine - syntactically at least. If that's not behaving as you expect then something entirely unrelated to anything you've told us is the cause. Usually you get more information from running the query manually as part of a QueryDef than running it from code.

The code is not even a starting point. Sorry, but you cannot simply reference table fields in VBA as if they were an object. Here's something for that (Access VBA DAO Recordset Loop Using Two Recordsets), but I suspect that's not where your focus needs to be just yet.

TBH, I suspect you need to focus on the SQL side. At least first.
Sep 30 '17 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Mark Oueis | last post by:
I've been struggling with this question for a while. What is better design? To design functions to return error codes when an error occures, or to have them throw exceptions. If you chose the...
8
by: Shane Groff | last post by:
I know this is a recurring discussion (I've spent the last 3 days reading through threads on the topic), but I feel compelled to start it up again. After reading through the existing threads, I...
1
by: Michael Bender | last post by:
Hi everybody, I would like to write ASP error codes in a log file. Error message would be for example: ADODB.Fields error '800a0cc1' Item cannot be found in the collection corresponding to...
3
by: Adam Bukla | last post by:
Hi! I started programming PostgreSQL database with libpq API (client side). It looks very easy, but unexpected I found problem, which I cannot solve myself. If function PQexec fails, I can get...
1
by: Grant Allen | last post by:
Hi all, I've been hunting around the techdocs site looking for a comprehensive listof error codes for certain errors. The only thing I can find is a list ofa few (textual) errors - nothing that...
0
by: HKSHK | last post by:
This list compares the error codes used in VB.NET 2003 with those used in VB6. Error Codes: ============ 3: This Error number is obsolete and no longer used. (Formerly: Return without GoSub)...
8
by: PW | last post by:
Hi, There is code in Alison Balter's excellant "Mastering Access 2003" to create a list of error codes and descriptions but it only generates error messages 3 through 94. Is there a website...
4
by: fatboySudsy | last post by:
Hi, I have constructed a client program that has given me some error codes that i just cannot see. I was wondering if a different set of eyes with much more experience than me could help me out. ...
13
by: mike3 | last post by:
Hi. (crossposted because the program is in C++ and some C++-related elements are discussed, hence comp.lang.c++, plus general program design questions are asked, hence comp.programming.) I'm...
5
by: =?GB2312?B?17/HvyBaaHVvLCBRaWFuZw==?= | last post by:
Hi, I would like to have someone comments on what's the best practice defining error codes in C. Here's what I think: solution A: using enum pros: type safe. better for debug (some debugger...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.