Import is appending data to table

T

Toby

In a similar thread to the one just posted by Roxanna

I want to import an Excel spreadsheet into a table in my
Access DB.

I am using following: DoCmd.TransferSpreadsheet
acImport, 0, "tblSchedule", "C:\mail\in\import.xls", false

This code works but it is appending to the table.

What is the best way to update the table - or would it be
best to delete the old table and then to create a new one
to import tha data into?

If the latter would be most elegant solution, can anyone
help with some code that would do this ?

Thanks

Toby
 
J

John Nurick

Hi Toby,

Don't delete the table, but delete the records it contains using
something like

CurrentDB.Execute "DELETE FROM tblSchedule", dbFailOnError

Alternatively, consider linking the spreadsheet instead of importing.
 

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