Delete records in a table

K

K

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)
 
K

K

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

Cheers
 
Top