S
Susan L
I created three delete queries, which I wanted to run via a click on the
button. First, when I used the button control wizard, I couldn't see the
queries on the list. Then i created the code (copied and pasted from another
button's code) with the proper name of the button. Now when I test it, I
receive a Label not defined error.
Here's the code:
Private Sub cmdDeleteEXAs_Click()
On Error GoTo Err_cmdDeleteEXAs_Click
Dim stDocName As String
stDocName = "qry_NCC_Exch_Agr_Delete"
DoCmd.OpenQuery stDocName, acNormal, acEdit
Exit_cmdDeleteEXAs_Click:
Exit Sub
Err_cmdDeleteEXAs_Click:
MsgBox Err.Description
Resume Exit_cmdDeleteEXAs_Click
End Sub
The query refers to the correct name of the table targeted for data deletion.
Any thoughts?
button. First, when I used the button control wizard, I couldn't see the
queries on the list. Then i created the code (copied and pasted from another
button's code) with the proper name of the button. Now when I test it, I
receive a Label not defined error.
Here's the code:
Private Sub cmdDeleteEXAs_Click()
On Error GoTo Err_cmdDeleteEXAs_Click
Dim stDocName As String
stDocName = "qry_NCC_Exch_Agr_Delete"
DoCmd.OpenQuery stDocName, acNormal, acEdit
Exit_cmdDeleteEXAs_Click:
Exit Sub
Err_cmdDeleteEXAs_Click:
MsgBox Err.Description
Resume Exit_cmdDeleteEXAs_Click
End Sub
The query refers to the correct name of the table targeted for data deletion.
Any thoughts?