Is it possible delete all entries in a table and reset the autonumber count?
I have tried:
Private Sub Command12_Click()
DELETE FROM a_test
End Sub
But it I get an error "Expected end of statement". I am using Access 2010.
My advice is not to worry so much about reseeding the autonumber. Let Access maintain it's uniqueness. If you need to reset it, look at the comments others have posted.
In regards to fixing your actual error, you're not actually running anything above. If you want to run a SQL statement, you can use CurrentDb.Execute or something like this:
Private Sub Command12_Click()
CurrentDb.Execute "DELETE FROM a_test"
End Sub
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With