J
Jeff C
I am trying to build my first automatic sequence in VB. I will have two or
three update queries following a delete query and finish with an append
query. My question: Is the following the correct way to enter the code in
the “on click†event property of a command button? Thanks for your help.
Private Sub Command0_Click()
On Error GoTo Err_Command0_Click
Dim stDocName As String
stDocName = "qry_delete"
DoCmd.OpenQuery stDocName, acNormal, acEdit
stDocName = "qry_update1"
DoCmd.OpenQuery stDocName, acNormal, acEdit
stDocName = "qry_update2"
DoCmd.OpenQuery stDocName, acNormal, acEdit
stDocName = "qry_update3"
DoCmd.OpenQuery stDocName, acNormal, acEdit
stDocName = "qry_append1"
DoCmd.OpenQuery stDocName, acNormal, acEdit
Exit_Command0_Click:
Exit Sub
Err_Command0_Click:
MsgBox Err.Description
Resume Exit_Command0_Click
End Sub
three update queries following a delete query and finish with an append
query. My question: Is the following the correct way to enter the code in
the “on click†event property of a command button? Thanks for your help.
Private Sub Command0_Click()
On Error GoTo Err_Command0_Click
Dim stDocName As String
stDocName = "qry_delete"
DoCmd.OpenQuery stDocName, acNormal, acEdit
stDocName = "qry_update1"
DoCmd.OpenQuery stDocName, acNormal, acEdit
stDocName = "qry_update2"
DoCmd.OpenQuery stDocName, acNormal, acEdit
stDocName = "qry_update3"
DoCmd.OpenQuery stDocName, acNormal, acEdit
stDocName = "qry_append1"
DoCmd.OpenQuery stDocName, acNormal, acEdit
Exit_Command0_Click:
Exit Sub
Err_Command0_Click:
MsgBox Err.Description
Resume Exit_Command0_Click
End Sub