Append duplicates into table

N

Niceaction

Hi,
I am trying to import data from a csv file and append it to another table.
Firstly, I import to a table. Then, using an Append query, I insert these
fields to the correct table.
When running the queries manually, If the values I am importing are
duplicates, then I am informed of this and that x amount of records will not
be updated. I am then asked if I want to continue with the update.
However, When I try to run the queries in VBA using the DoCmd.OpenQuery
function, I get an error that I dont know how to resolve (number 2496). How
do I get it to just update the non duplicate values?
Thank you
 
A

Alex Dybenko

You can modify your query, so it append only non-duplicate value - you can
use left join to link both tables by unique field(s) and set criteria that
values on destitation table is null
HTH
 
N

Niceaction

Excellant.. That works perfectly.

I dont suppose there is a way to capture the number of rows that the query
will append is there? I can then match this back to the table I have
imported to and see if the values match (this will highlight duplicates that
wont be appended)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top