Import new data and replace old data in Access table.

T

TBui

I try to import new data (from Excel) into an existing Access table. However,
Access only allow me to either APPEND the new data to an existing table
(which creates redundancies of records) or Link. Would you please show me how
to import the new data and have them replace the existing records. Thanks so
much in advance!!!!
 
P

Piet Linden

I try to import new data (from Excel) into an existing Access table. However,
Access only allow me to either APPEND the new data to an existing table
(which creates redundancies of records) or Link. Would you please show mehow
to import the new data and have them replace the existing records. Thanksso
much in advance!!!!

If you really want to replace the records that are in the
spreadsheet, do this:
1. create a link to the Excel table.
2. create a delete query... something along the lines of...
DELETE *
FROM AccessTable
WHERE AccessTable.PrimaryKey = ExcelFile.UniqueID

Then run your insert.

OR, if you are not changing the existing data,
1. create the linke to excel file
2. run the find unmatched query wizard, which returns a select
query.
3. Turn it into an append query.
 
P

Piet Linden

I try to import new data (from Excel) into an existing Access table. However,
Access only allow me to either APPEND the new data to an existing table
(which creates redundancies of records) or Link. Would you please show mehow
to import the new data and have them replace the existing records. Thanksso
much in advance!!!!

If you really want to replace the records that are in the
spreadsheet, do this:
1. create a link to the Excel table.
2. create a delete query... something along the lines of...
DELETE *
FROM AccessTable
WHERE AccessTable.PrimaryKey = ExcelFile.UniqueID

Then run your insert.

OR, if you are not changing the existing data,
1. create the linke to excel file
2. run the find unmatched query wizard, which returns a select
query.
3. Turn it into an append query.
 
T

TBui

Piet Linden said:
If you really want to replace the records that are in the
spreadsheet, do this:
1. create a link to the Excel table.
2. create a delete query... something along the lines of...
DELETE *
FROM AccessTable
WHERE AccessTable.PrimaryKey = ExcelFile.UniqueID

Then run your insert.

OR, if you are not changing the existing data,
1. create the linke to excel file
2. run the find unmatched query wizard, which returns a select
query.
3. Turn it into an append query.

Thank you so much for your help!
 
T

TBui

Piet Linden said:
If you really want to replace the records that are in the
spreadsheet, do this:
1. create a link to the Excel table.
2. create a delete query... something along the lines of...
DELETE *
FROM AccessTable
WHERE AccessTable.PrimaryKey = ExcelFile.UniqueID

Then run your insert.

OR, if you are not changing the existing data,
1. create the linke to excel file
2. run the find unmatched query wizard, which returns a select
query.
3. Turn it into an append query.

Thank you so much for your help!
 

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