Importing new records into existing database

knarlyd@hotmail.com

Registered User.
Local time
Today, 15:25
Joined
Sep 6, 2013
Messages
43
I have table1 in my (Access 2010) database that has exising records. I have another table2 that after I run a query, it first deletes the data in table 2, then imports new records into that table. I run the import into table 2 on a semi regular basis but have yet to copy those records into table 1.

With that said, using either a query or VB, how do I copy all the (new) records from table 2 into table 1 without altering any records that already exist in table1?
BTW, Table 1 has a main form with a subform within it.

Thanks!:o
 
Use an append query and verify in the query if the record in table 2 already exist in table 1 by joining the tables on unique fields in the query and filtering the new records
 
Just use an Append query.

I should have clarified a bit more. Each time the data is pulled into table 2, I need to copy only the records from table 2 to table one if the records don't already exist in table1. So, each time the query or vba code would run, it would be continuing to grow table 1.
As an example, it's data from the Outlook GAL so each time table2 imports that data, it needs to be added to table1, only if it doesn't already exist.

Does an Append query still apply? If so, any examples that can provided would be very helpful.

THanks!
 
Use an append query and verify in the query if the record in table 2 already exist in table 1 by joining the tables on unique fields in the query and filtering the new records

Sounds good, but unfortuantely, I don't know how to write a query like that....
Any examples would be greatly appreciated.

Thanks!
 
try to describe it, suggesting you know how to make a query in Access

-start a new query
-put in both table1 and table2
-select all fields from table2 to be put in table1
-make it an append query
-join table2 to table1 on unique fields (mostly 1 or 2 fields)
-make the join 1 to more (meaning all from table2, with or without match to table1)
-put in a unique field from table1 as a selected field
-make the criteria for that field "Is Null", meaning the records in table2 should not be in table1
-be sure that this selection field from table1 has no output (deselect the mark)!! if you select 'Group By', than this field would be 'Where'

Give it a try!
 

Users who are viewing this thread

Back
Top Bottom