Append Query

P

Paul W Smith

I have the following situation. I have a table of data which I want to
update with the latest information which I will obtain from another source.
To obtain the information I have output the current contents of the table to
an Excel file, which I intend to send to my source for them to update.

When my source returns the Excel file, some of the records will have had
fields updated, while new records will also have been added. No new fields
will have been created.

What is the best way to get the new information over the existing?

I did think I could just delete the old table data and then append all the
new data, but as relationships exists Access warns me when I come to delete
the old info.

I can write a query that updates the existing records because the same
primary key exists in the old Table and the new Excel one. However, what I
cannot seem to find a way to do is after I have updated the existing
records, then append the new ones!

can anyone offer any advice or code?
 
G

GBA

if you are certain that a bulk replace of the entire table is safe; then
write a delete query to clear out all the existing records (this will not
delete the table and create the relationship issue you mention)...and then
the append query to put all the new records in....
 
P

Paul W Smith

Thanks that was very easy!

GBA said:
if you are certain that a bulk replace of the entire table is safe; then
write a delete query to clear out all the existing records (this will not
delete the table and create the relationship issue you mention)...and then
the append query to put all the new records in....
 

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