Code to delete and add record to table

  • Thread starter Thread starter Ayo
  • Start date Start date
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.
 
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]"
 
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.
 

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

Back
Top