Code to delete and add record to table

A

Ayo

I would like to write a code that performs the following action:
1. Delete all records from a table
2. Run an append query and add it to the table
3. save the table

I am somewhat confident about that last two, 2 and 3, but I don't know how
to go about doing 1. Any help will be greatly appreciated.
Thanks.
 
B

Bob Quintal

I would like to write a code that performs the following action:
1. Delete all records from a table
2. Run an append query and add it to the table
3. save the table

I am somewhat confident about that last two, 2 and 3, but I don't
know how to go about doing 1. Any help will be greatly
appreciated.
Thanks.
Docmd.runsql "Delete * from [a table]"
 
S

Steve Schapel

Ayo,

CurrentDb.Execute "DELETE FROM NameOfYourTable", dbFailOnError

Not sure what you mean by step 3., save the table. This would only
apply if there are design changes made to the table, which does not seem
to apply to your procedure.
 
Top