473,472 Members | 1,746 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Append new records to table syntax

As part of a macro, I'm trying to automate appending a table with new
records.

let's say the table 2 has some new records in it, but also has a lot
of identical records to table 1.

I would like to append table 1 with all of the new records, and do it
unattended in a macro.

Is there a way to specify in the append query to only append the
records that do not already match the linking fields in each table?

Since there can be no duplicated in the primary key, I know that I
could just run it and agree that some records can't be appended (the
same way you get rid of duplicates), but can I do this unattended with
no prompts? Otherwise I'm looking for a way to do this by just
specifying in the criteria just to update records where the "field1"
in table 1 does not match "field1" in table 2: but I've tried that and
I just get an error.

Thanks,

Larry
- - - - - - - - - - - - - - - - - -
"Forget it, Jake. It's Chinatown."
Nov 13 '05 #1
3 2893
Hi Larry,

Suggest writing an update query and then running the query from your macro.
Query would be something as simple as this assuming your tables have
identical fields:

INSERT INTO tblPerson
SELECT tblPersonDup.*
FROM tblPersonDup
WHERE (((tblPersonDup.PersonID) Not In (select PersonID from tblPerson)));

This appends records to tblPerson if PersonID does not already exist.

In your macro you'd have these commands:

SetWarnings No
OpenQuery Your query name here
SetWarnings Yes

HTH -Linda

"Larry Rekow" <larry@netgeexdotcom> wrote in message
news:0o********************************@4ax.com...
As part of a macro, I'm trying to automate appending a table with new
records.

let's say the table 2 has some new records in it, but also has a lot
of identical records to table 1.

I would like to append table 1 with all of the new records, and do it
unattended in a macro.

Is there a way to specify in the append query to only append the
records that do not already match the linking fields in each table?

Since there can be no duplicated in the primary key, I know that I
could just run it and agree that some records can't be appended (the
same way you get rid of duplicates), but can I do this unattended with
no prompts? Otherwise I'm looking for a way to do this by just
specifying in the criteria just to update records where the "field1"
in table 1 does not match "field1" in table 2: but I've tried that and
I just get an error.

Thanks,

Larry
- - - - - - - - - - - - - - - - - -
"Forget it, Jake. It's Chinatown."

Nov 13 '05 #2
Hi Larry

Create a new query and select "Find Unmatched Query Wizard", follow the
instructions and save the query. Go into the design view of this query and
change it to an Append query, or use this query as the recordsource for your
Append query.

Jeff
"Larry Rekow" <larry@netgeexdotcom> wrote in message
news:0o********************************@4ax.com...
As part of a macro, I'm trying to automate appending a table with new
records.

let's say the table 2 has some new records in it, but also has a lot
of identical records to table 1.

I would like to append table 1 with all of the new records, and do it
unattended in a macro.

Is there a way to specify in the append query to only append the
records that do not already match the linking fields in each table?

Since there can be no duplicated in the primary key, I know that I
could just run it and agree that some records can't be appended (the
same way you get rid of duplicates), but can I do this unattended with
no prompts? Otherwise I'm looking for a way to do this by just
specifying in the criteria just to update records where the "field1"
in table 1 does not match "field1" in table 2: but I've tried that and
I just get an error.

Thanks,

Larry
- - - - - - - - - - - - - - - - - -
"Forget it, Jake. It's Chinatown."

Nov 13 '05 #3
On Mon, 13 Sep 2004 13:12:18 +1200, "Jeff Smith"
<No***@Not.This.Address> wrote:
Hi Larry

Create a new query and select "Find Unmatched Query Wizard", follow the
instructions and save the query. Go into the design view of this query and
change it to an Append query, or use this query as the recordsource for your
Append query.

Jeff

++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++
Thanks to you, Jeff, and squirrel for putting me right.

My brain was about to break (and still might!).

Laterz,

Larry

- - - - - - - - - - - - - - - - - -
"Forget it, Jake. It's Chinatown."
Nov 13 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: JMCN | last post by:
hi i have a general question regarding append queries in access 97. each week i need to update my table(tblonlinereg) with new or modified records. firstly, i import the text file into my...
2
by: anita | last post by:
I am sorry if this sounds as a silly problem. I have table 1 with 10 records and table 2 with 20 records. I want to append 20 records from Table 2 to table 1. But when I run the append query, the...
3
by: JOEP | last post by:
What do I need to do to allow an append query to post null values to records in a field of the destination table? Basically I want to allow records with null values to post to the table. The append...
5
by: Michael C via AccessMonster.com | last post by:
Hello, I have a table that I am appending 3 seperate tables into. My main problem is that each time I append the data, it simply adds to the data already there. That might sound ok, except that...
4
by: robboll | last post by:
When I try to use an append query from an oracle link it takes forever. I am exploring the idea of doing an append action using a pass-through query. If I have an Oracle ODBC connection to...
4
by: MN | last post by:
I have to import a tab-delimited text file daily into Access through a macro. All of the data needs to be added to an existing table. Some of the data already exists but may be updated by the...
4
by: pmacdiddie | last post by:
I have an append query that needs to run every time a line item is added to a subform. The append writes to a table that is the source for a pull down box. Problem is that it takes 5 seconds to...
3
by: wvmbark | last post by:
First time poster... I just found this forum and it appears there's plenty of people here that could make short work of problem that's been driving me absolutely bonkers for months. Every day we...
1
by: hr833 | last post by:
hi.. i'm using a append query to filter some new records that must be updated in the lookup table. In this lookup table it consist of the part number and the type of the product. the part number...
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
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...
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...
1
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,...
1
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...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.