I have form with a Close button. When the button is closed, I want it to
first delete all records in tblCustomerID then close the form.
I would like the delete query to just run and not prompt me over and over
and over to confirm because I WANT to DELETE them.
If it's better to run it as SQL code and not a separate query, that's cool,
but I have no idea how to do this.
Heres the code behind the OnClick event:
Private Sub cmdCloseForm_Click()
On Error GoTo Err_cmdCloseForm_Click
' This statement runs the query to delete all recordsfrom the
temporary table tblCustomerID
DoCmd.OpenQuery "qry_Lookup_DeleteCID"
DoCmd.Close
Exit_cmdCloseForm_Click:
Exit Sub
Err_cmdCloseForm_Click:
MsgBox Err.Description
Resume Exit_cmdCloseForm_Click
End Sub
_______________________________________
Any help is deeply appreciated,
Presto