Suppressing Message Box

  • Thread starter Thread starter DubboPete
  • Start date Start date
D

DubboPete

Hi all,

I have a report, which, if someone tries to print and there is no data
for the report, comes up with a custom message alerting the user, and
the OpenReport action is cancelled. On clicking ok, I then get the MS
Access message "The OpenReport Action was cancelled" popping up too.

Is there any way to suppress the Access message?

tia

DubboPete
 
Hi all,

I have a report, which, if someone tries to print and there is no data
for the report, comes up with a custom message alerting the user, and
the OpenReport action is cancelled. On clicking ok, I then get the MS
Access message "The OpenReport Action was cancelled" popping up too.

Is there any way to suppress the Access message?

tia

DubboPete

Code the event that is used to open the report:

On Error GoTo Rrr_Handler

DoCmd.OpenReport "ReportName" etc...

Exit_Sub:
Exit Sub
Err_Handler:
If Err = 2501 Then
Else
MsgBox "Error #: " & Err.Number & " " & Err.Description
End IF
Resume Exit_Sub
 
fredg said:
Code the event that is used to open the report:

On Error GoTo Rrr_Handler

DoCmd.OpenReport "ReportName" etc...

Exit_Sub:
Exit Sub
Err_Handler:
If Err = 2501 Then
Else
MsgBox "Error #: " & Err.Number & " " & Err.Description
End IF
Resume Exit_Sub

Thanks Fred,

I actually had to put it in the OnClick code of the command button that
fired the report, but it worked perfectly!
many thanks

Pete
 
Thanks Fred,

I actually had to put it in the OnClick code of the command button that
fired the report, but it worked perfectly!
many thanks

Pete

Isn't that what I wrote?
 
Back
Top