Delete all record from an Access table using VBA

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

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