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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

On No Data Event 3

Status
Not open for further replies.

Mike555

Technical User
Feb 21, 2003
1,200
US
What syntax is used in a <b>On No Data</b> event that closes the report (or just stops it from displaying in the first place), if there is no data?

Thanks.
 
I forgot to mention that you could also add a MsgBox function to inform the user that no records were found:
Code:
MsgBox (&quot;No records met your criteria&quot;)
Cancel = True
 
This is very helpful, thanks! One other question -- I get a Run-Time Error '2501' when my report closes. Is there a way to avoid the error?
Thanks!
 
Are you opening this report through a command button? Could you post the code from the On Click event?
 
One more question: Is there a way to define what words appear on the title bar of the dialog box? By default it just says Microsoft Access. Thanks.
 
Sure...
Code:
MsgBox &quot;No records met your criteria&quot;, , &quot;Custom title Here&quot;
The third argument is for the title. Check out the MsgBox function in access help to see more arguments such as the type of buttons, icon style, etc.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top