P
Perry Kew
I have the following code attached to a button in a form.
It opens the report when all goes well. When cancel is
clicked it gives me the error message below. I was
wondering if someone could tell me what I can do to make
it such that when the Cancel button is clicked, it just
goes back to the form and does not display the message
box.
Thanks for your help.
On Error GoTo Err_cmdClosedBy_Click
DoCmd.OpenReport "rptBooksMags", acViewPreview
DoCmd.Maximize
Exit_cmdClosedBy_Click:
Exit Sub
Err_cmdClosedBy_Click:
MsgBox "The BooksMag Report has been cancelled"
Resume Exit_cmdClosedBy_Click
It opens the report when all goes well. When cancel is
clicked it gives me the error message below. I was
wondering if someone could tell me what I can do to make
it such that when the Cancel button is clicked, it just
goes back to the form and does not display the message
box.
Thanks for your help.
On Error GoTo Err_cmdClosedBy_Click
DoCmd.OpenReport "rptBooksMags", acViewPreview
DoCmd.Maximize
Exit_cmdClosedBy_Click:
Exit Sub
Err_cmdClosedBy_Click:
MsgBox "The BooksMag Report has been cancelled"
Resume Exit_cmdClosedBy_Click