Delete Data from Table and Import New Data

S

Sam

I have a database with17 tables that need to be updated with new data
on a regular basis. The data in the current tables need to be deleted
and then new data in the form of a .txt file needs to be imported to
the now empty tables, to save field formatting. I am hoping someone
could provide me with some code to do this automatically instead of
one at a time.

Any help would be appreciated
 
D

Dorian

You will need a VB procedure to do this, you first delete all the data in
each table then import the new data. The new data will have to have EXACTLY
the same columns as the previous data in order to be able to reuse the table.
To delete the data you run the following SQL for each of your 17 tables:
DELETE * FROM MyTable1
In Access Help, look up the RUNSQL and TRANSFERTEXT commands
-- Dorian
"Give someone a fish and they eat for a day; teach someone to fish and they
eat for a lifetime".
 

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