I have the following code in a command button:
Private Sub PackingSlipButton_Click()
On Error GoTo Err_PackingSlipButton_Click
Dim stDocName As String
stDocName = "EmployeePackingSlip"
DoCmd.OpenReport stDocName, acPreview
Exit_PackingSlipButton_Click:
Exit Sub
Err_PackingSlipButton_Click:
MsgBox Err.Description
Resume Exit_Preview_Report_Click
End Sub
When I click on the button I get the error message "Compile Error: Label Not Defined", and it highlights my first line of code. Everything in it looks fine to me and is referencing correct objects. Does anyone know what the problem might be?
Thanks!!!
Private Sub PackingSlipButton_Click()
On Error GoTo Err_PackingSlipButton_Click
Dim stDocName As String
stDocName = "EmployeePackingSlip"
DoCmd.OpenReport stDocName, acPreview
Exit_PackingSlipButton_Click:
Exit Sub
Err_PackingSlipButton_Click:
MsgBox Err.Description
Resume Exit_Preview_Report_Click
End Sub
When I click on the button I get the error message "Compile Error: Label Not Defined", and it highlights my first line of code. Everything in it looks fine to me and is referencing correct objects. Does anyone know what the problem might be?
Thanks!!!