473,659 Members | 2,681 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

"Microsoft Office Access can't append all the records in the append query"

1 New Member
Hi,
I get the following error when I try to save data using append query for the save button in the form.
"Microsoft Office Access can't append all the records in the append query"

Here is some detail:
Expand|Select|Wrap|Line Numbers
  1. Private Sub btnSaveToDatabase_Click()
  2.     Dim strSubcontractNumber As String
  3.     Dim strSCNJTag As String
  4.     Dim strSCNJ As String
  5.  
  6.     strSubcontractNumber = txtSubcontractNumber.value
  7.  
  8.     If (txtSCNJTag.value >= 100 And txtSCNJTag.value < 999) Then
  9.         strSCNJTag = txtSCNJTag.value
  10.     End If
  11.     strSCNJ = strSubcontractNumber & "-SCNJ" & "-" & strSCNJTag
  12.     MsgBox "You are about to add  " & strSCNJ & " to the database.  Press OK to proceed.", vbOKCancel, "Adding to database..."
  13.  
  14.     DoCmd.SetWarnings False
  15.     DoCmd.OpenQuery "app_AppendCurrentSCNJ"
  16.     DoCmd.OpenQuery "app_AppendCurrentCostAnalysis"
  17.     DoCmd.OpenQuery "app_AppendCurrentDocuments"
  18.     DoCmd.SetWarnings True
  19. End Sub
Now in all the three append queries there is a field named "SCNJCounte r" which has autonumber datatype in table and is primary key field with no duplicate value.
When I click save button on the form it says ok . But the record I saved is not there in the following table and when I checked datasheet view in query is shows new record with same SCNJCounter value. when I try to run the query it returns the error above.I know records are not saved in table because SCNJCounter is not incrementing but don't get why.
Your help will be greatly appreciated.
Thank you in advance...
Mar 1 '12 #1
1 1957
NeoPa
32,568 Recognized Expert Moderator MVP
Your error message is not complete. You included only the least helpful part and omitted the important details explaining how many and why records failed.

Your code has not been taken from your project (unless you have used a variable called Value and spelled it with a lower-case 'v' to confuse Access). It's necessary that you follow these instructions carefully when posting code - Before Posting (VBA or SQL) Code.

You give us no real information that pertains to your problem that makes sense without your database to hand. No indication of what your queries do, and not even any indication of which line the error message you've half-shared is triggered by (I'm assuming it's only a single query you're referring to. I can't imagine anyone thinking that describing a problem which is repeated over three queries as if it were only one, makes any sense).

If you can fill in the missing information intelligently then we may be able to help.
Mar 1 '12 #2

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

Similar topics

2
2715
by: Ellen Manning | last post by:
Using A2K. In my table I have the field "Grant" which can have a value or be null. I have a query that counts the number of records and has a Where clause on the Grant field. The query won't work when Grant is null. What's the proper syntax for getting it to work when Grant is null? Here's my Where criteria: !!
0
1336
by: jimmojelsky | last post by:
Access97 database - it is set up to share between several computers - some users have full access, others only have read access - locking is set at "no lock" - everything works unless one of the workstations has an open query - the other workstations then get a "records locked" message if they attempt to run a query - I have been trying to solve this one for quite some time - can anyone help? -- Posted via http://dbforums.com
7
4244
by: | last post by:
I found similiar issues in MS-KB but nothing that helped me; got the Windows and Office updates from the MS website but that hasn't changed the behavior of this problem, and I don't see anything relevant in the newsgroup; help will be gratefully received. Windows 2000 system, I'm logged in with admin rights, using Office 2003. I have two databases on my local drive, in the same subdirectory. In the database HAMCHEESE, I create an...
8
11223
by: RC | last post by:
In my Access 2002 form, I have a combo box and on the AfterUpdate event I use DoCmd.RunSQL ("UPDATE .... to update records in a table. When it starts to run I get a message "You are about to update 3 row(s)." Is there a way to prevent the message from popping up?
9
18545
by: Mike Bridge | last post by:
I am using MS Access 2003, and I typed in a query in SQL view which was working fine. Now when I open it, it gives me the error "Join expression not supported". Apparently, Access "fixed" it for me. Unfortunately, I can't correct it because when I click "OK", the window disappears. I don't see any way to open the query directly in SQL view, and both the Design and Data views exit as soon as I close the error dialog. Is there any way...
3
1912
by: MLH | last post by:
I have a query, qryAppend30DayOld260ies that attempts to append records to tblCorrespondence. When run, it can result in any of the following: appending no records, appending 1 record or appending many records. Two of the target fields in tblCorrespondence receiving values in the append operation are and . For any given VehicleJobID value, I want only ONE record in correspondence table to have an value of "01". This query blindly appends...
4
15751
by: Mike D | last post by:
OS: Windows XP Professional Microsoft Access 2003 I am trying to update a table in my DB from a tempory table. I need to ensure that if records in the main table match records in the temp table (on the keys) they are replaced/updated by the new data in the temp table. the vba code i am running is below: Dim mySQL As String
1
2122
by: mlumsden | last post by:
OK So here's my essential Dilemma. I have set up my Table to import from 3 excel files and 1 other table. The Excel files may or may not be updated at the time of each refresh of my Table "Candid" (for Candidates). Each record is autonumbered (meaning every refresh the number may change, because I delete all records and refresh from the files/table). I want to enable functionality which will allow modifications to records in the Candid...
3
31931
by: nickvans | last post by:
Hello all, I have (hopefully) an easy question for you all. I'm running Access '03 and have created a pile of VBA code to create a form and some queries related to each control in the form. (Basically, it uses structured naming conventions to create a form with a bunch of combo boxes that allow the user to easily add and remove controls... anyway--) I am using the statement With CurrentDb .QueryDefs.Delete ("qryName") Set qrydef =...
4
10357
by: dougmeece | last post by:
Hello everyone, I have created a search button but I receive the message "Microsoft Access can't fine the field "|" referred to in your expression" when I try to use it. I have looked online for this error but the fix did not pertain to this problem because the table or field name did not match any reservered Access words as described. My records search form will have two combo boxes and one or two search buttons. I am just trying to...
0
8428
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8339
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8851
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8535
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8629
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7360
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6181
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4338
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1739
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.