jcaptchaos2
Well-known Member
- Joined
- Sep 24, 2002
- Messages
- 1,032
- Office Version
- 365
- Platform
- Windows
Is there a way to avoid a run time error when someone presses the cancel button ?
Private Sub Check_transaction_report_Click()
DoCmd.OpenReport "Shop Floor Data Query1", acViewReport
DoCmd.Maximize
Me.Visible = False
End Sub
Private Sub Check_transaction_report_Click()
On Error GoTo Check_transaction_report_err
DoCmd.OpenReport "Shop Floor Data Query1", acViewReport
DoCmd.Maximize
Me.Visible = False
Check_transaction_report_Exit:
Exit Sub
Check_transaction_report_Err:
If Err.Number <> 2501 Then
MsgBox Err.Description, vbExclamation, "Error #: " & Err.Number
Resume Check_transaction_report_Exit
Resume
End If
End Sub