Your problem is being caused because of the macro. The cancel event on the report doesn't stop the macro from running, it just stops the form from opening. The print command still runs and since the form is now active instead of the report it is printing the form.
Instead of using a Macro to print the report you need to open it directly from the command button that you click to print. Assuming your button is named print the vba for the on click event would be as follows. Just replace ReportName with the actual name of your report.
- Private Sub Print_Click()
-
On Error GoTo ErrPoint
-
DoCmd.OpenReport "ReportName", acViewNormal
-
-
ExitPoint:
-
Exit Sub
-
-
ErrPoint:
-
If Err.Number = 2501 Then
-
MsgBox "Report Cancelled"
-
Resume ExitPoint
-
Else
-
MsgBox Err.Number & " " & Err.Description
-
End If
-
End Sub
The cancel event generates error number 2501 that you can trap and use to display your message box.