remove records

  • Thread starter Thread starter Yvonne
  • Start date Start date
Y

Yvonne

Hi I need to delete all records from a table in my
database. I have a button on a table maintenance form
which I would like to run the code from. Only data
should be removed.

my table is tblplacenames

thanks

Yvonne
 
Yvonne,

Put this code in the button's On Click event:

cnt = DCount("*", "tblplacenames")
strSQL = "DELETE * FROM tblplacenames"
CurrentDb.Execute strSQL
MsgBox cnt & " Records deleted.", vbInformation, "Place Names table"

HTH,
Nikos
 

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

Back
Top