clear records

  • Thread starter Thread starter marco_pb via AccessMonster.com
  • Start date Start date
M

marco_pb via AccessMonster.com

hi all, thanks for helping me this far..
I have got a question from a user. He asked me if it is possible to make a
button in a form to clear all records in tables when clicked.
if possible how can i do it? if not, what is a better solution for it?

thank you in advance..
 
Use a delete Query and put theis code on the Click event of you button

On Error GoTo Err_cmdRunQuery_Click

Dim stDocName As String

stDocName = "YourQueryName"
DoCmd.OpenQuery stDocName, acNormal, acEdit

Exit_cmdRunQuery_Click:
Exit Sub

Err_cmdRunQuery_Click:
MsgBox Err.Description
Resume Exit_cmdRunQuery_Click

I suggest you make a copy of the data, just to be on the safe side!!!


Dave
 
thanks for the reply dave, but what i want is in the switchboard, i put the
button and when i click it the whole record in the database will be gone. so
that it became a database with empty records..

thank you again in advance
 
Back
Top