forms

  • Thread starter Thread starter Cooky
  • Start date Start date
C

Cooky

I have a form that opens various reports. Have report
set for On No Data, However the from shows message "Open
report action was canceled. How can I make that message
disappear. Only want message as I entered in On No data.
 
I have a form that opens various reports. Have report
set for On No Data, However the from shows message "Open
report action was canceled. How can I make that message
disappear. Only want message as I entered in On No data.

You need to add error handling to trap the error 2501 in the code on
the form that opens the report:

On Error GoTo Err_Handler
DoCmd.OpenReport "ReportName"

Exit_This_Sub:
Exit Sub
Err_Handler:
If Err = 2501 Then
Else
MsgBox "Error #: " & Err.Number & " " & err.Description
End If
Resume Exit_This_Sub
 
Back
Top