Delete all record from an Access table using VBA

D

databaser

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?
 
D

Dirk Goldgar

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
 
Top