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_Cl ick()
On Error GoTo Err_cmdCloseFor m_Click
' This statement runs the query to delete all recordsfrom the
temporary table tblCustomerID
DoCmd.OpenQuery "qry_Lookup_Del eteCID"
DoCmd.Close
Exit_cmdCloseFo rm_Click:
Exit Sub
Err_cmdCloseFor m_Click:
MsgBox Err.Description
Resume Exit_cmdCloseFo rm_Click
End Sub
_______________ _______________ _________
Any help is deeply appreciated,
Presto
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_Cl ick()
On Error GoTo Err_cmdCloseFor m_Click
' This statement runs the query to delete all recordsfrom the
temporary table tblCustomerID
DoCmd.OpenQuery "qry_Lookup_Del eteCID"
DoCmd.Close
Exit_cmdCloseFo rm_Click:
Exit Sub
Err_cmdCloseFor m_Click:
MsgBox Err.Description
Resume Exit_cmdCloseFo rm_Click
End Sub
_______________ _______________ _________
Any help is deeply appreciated,
Presto
Comment