Code:
Sub PrintInvoice_Click()
' This code created by Command Button Wizard.
On Error GoTo Err_PrintInvoice_Click
Dim strDocName As String
strDocName = "Invoice"
' Print Invoice report, using Invoices Filter query to print
' invoice for current order.
DoCmd.OpenReport strDocName, acViewNormal, "Invoices Filter"
Exit_PrintInvoice_Click:
Exit Sub
Err_PrintInvoice_Click:
' If action was cancelled by the user, don't display an error message.
Const conErrDoCmdCancelled = 2501
If (Err = conErrDoCmdCancelled) Then
Resume Exit_PrintInvoice_Click
Else
MsgBox Err.Description
Resume Exit_PrintInvoice_Click
End If
End Sub