Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to handle no data on a report...

Status
Not open for further replies.

Goot

Programmer
Aug 4, 2005
86
US
I placed a message box that will display "NO Data" in my report no_data property with the cancel value set to true. However, when control passes back to the docmd.openreport ..... line, I am getting error 2501 "The open report action was cancelled. What am I missing?

Thanx all
 
In your button's OnClick code, put this:

On Error Resume Next
DoCmd.OpenReport "SomeReport", acViewPreview
If Err = 2501 Then Err.Clear


Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244. Basics at
 
OR in the on 'no data' event of the report, put...

msgbox "No records found"


Program Error
Programmers do it one finger at a time!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top