Deleting all records in a table

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a form and a command button. I want to use the on click event
property of the command button to delete all records in my table called
mytable with 2 fields in it. field1 and field2. I hope I can do it. I think
I may have to create a function in a module or something. If anyone has any
suggestions please help.

Thanks, Brian
 
This line of code in the button's Click event procedure should remove all
records from MyTable:

dbEngine(0)(0).Execute "DELTE FROM MyTable;", dbFailOnError
 
Thanks, Allen

Allen Browne said:
This line of code in the button's Click event procedure should remove all
records from MyTable:

dbEngine(0)(0).Execute "DELTE 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

Back
Top