Delete all record from an Access table using VBA

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a work table that I have to clear before my next run. In SQL I used
truncate to empty it. This doesn't work in Access VBA. Does anyone know a
quick way to empty a table in VBA without looping through and using tb.delete?
 
databaser said:
I have a work table that I have to clear before my next run. In SQL
I used truncate to empty it. This doesn't work in Access VBA. Does
anyone know a quick way to empty a table in VBA without looping
through and using tb.delete?

CurrentDb.Execute "DELETE FROM MyTable", dbFailOnError
 
Back
Top