Delete records in a table

G

Guest

Good day,

How do I delete all the records in a table without deleting the table itself
via Macro.

Thanks in advance
 
D

Douglas J. Steele

CurrentDb.Execute "DELETE FROM MyTable", dbFailOnError

(replace MyTable with the actual table name)

(Note that if you have referential integrity turned on, you have to ensure
that you delete the data in the correct order)
 
G

Guest

Thanks for the response. All I did that worked for me was created a Delete
Query. Simple and quick.

Cheers
 

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