JohnC said:
And perhaps if you don't want to create a query object:
Dim db As DAO.Database
Dim strSQL as String
strSQL = "DELETE tablename.* FROM tablename;"
db.Execute strSQL, dbFailOnError
db.Close
Set db = Nothing
You forgot to set db to a reference to the current database:
Set db = CurrentDb
But you don't want to try to close the current database (even if you try,
your attempt will be ignored), so remove this line:
For that matter, the following line of code can replace all of the above:
CurrentDb.Execute "DELETE* FROM tablename", dbFailOnError