macro for deleting records

  • Thread starter Thread starter walterISCD
  • Start date Start date
W

walterISCD

I'm trying to create a macro in Access to delete all the records from a table
and save the empty table to start a new query that will put data in this
table.
In VBA I can't find the command to delete all records.
Can someone help?
Thanks
 
Walter,

I agree with Pete, you can make a Delete Query to delete all records
from the table. After which you can run this via a macro using the
OpenQuery action. You may want to precede the OpenQuery with a
SetWarnings/No action to suppress the display of the action query
confirmation message.

You seem to be confusing macros and VBA. An alternative in VBA would be
using code like this:
CurrentDb.Execute "DELETE * FROM YourTable", dbFailOnError
 
Back
Top