Delete Data from Table and Import New Data

  • Thread starter Thread starter Sam
  • Start date Start date
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
 
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".
 
Back
Top