Append Query with Duplicate Primary Key Records

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi all, first time in Access Group.

I have a question and I cannot seem to find the answer anywhere in the
discussion groups or on the Access Online Help. I am hoping that some one
here may have an answer or have come accross this before.

I have created an append query that will take information from a table,
imported from an excel spreadsheet and append another table in the current
database. There is an issue in which there can be duplicates of primary keys.
Access will not append the table with the information that originated from
the excel sheet. I just get the usual message indicating that all records
were not appended. At this point I do not know which records were not
imported unless I open the tables and the spreadsheet and begin "eyeballing"
the data.

What I would like to do... is that the data that is not appended, because it
is a result of a duplicate primary key, is to have that data not appended
populate a third table so that if this happens, I can investigate and correct
the data if necessary.

Can this be done fairly easy or will this require some SQL or VBA. My SQL
and VBA are probably at a 2nd grade level so I hope it would be fairly easy.

Thanks in Advance for any help.
 
1. create a _link_ to your spreadsheet in your database. (File, Get
External Data, Link, Change type to Excel...)
2. use the find unmatched query wizard to determine the records in the
excel file that you can import into the Access table without error.
(link on the primary key).
3. If you use a normal join between the two tables in your query,
you'll see the records that exist in both tables, in case you need it.
 
Back
Top