Public Sub Test()
On Error GoTo ErrorHandler
DoCmd.RunCommand acCmdPrint
ErrorHandlerExit:
Exit Sub
ErrorHandler:
If Err.Number = 2501 Then
Resume ErrorHandlerExit
Else
MsgBox "Error No: " & Err.Number _
& " in Test procedure; " _
& "Description: " & Err.Description
Resume ErrorHandlerExit
End If
End Sub
|