OpenReport action canceled...

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Stuart's question is mine exactly. If one deliberately canceled the report,
one does not wish to be notified of the fact.

Thank you, in anticipation.
 
Stuart who? What question?

Feel free to describe your situation and question in the body of your
posting.
 
Include error handling in the code that performs the OpenReport.

Trap and ignore error 2501. This kind of structure:

Private Sub cmdPrint_Click()
On Error Goto Err_Handler

DoCmd.OpenReport "Report1", acViewPreview

Exit_Handler:
Exit Sub

Err_Handler:
If Err.Number <> 2501 Then
MsgBox "Error " & Err.Number & " - " & Err.Description
End If
Resume Exit_Handler
End Sub
 
Duane:

Thank you for the response. Somehow I inadvertantly disembodied my post from
the thread I was reading with Stuart's question. My apologies.

Allen correctly guessed my needed response, so I have the answer this time.
Thanks again.
 
Thank you Allen. As I mentioned to Duane, I inadvertantly separated my post
from the thread I thought I was piggybacking on. So, thank you for taking a
stab at it. You got it correct. Now I know that the cancel event simply
generates an error condition which must be trapped for.

Thank you again for your incessant help. It is much appreciated.
 
Back
Top