No Data Event-Please help,should be easy

jamesc

New member
Local time
Today, 04:53
Joined
Jul 19, 2000
Messages
7
Can someone explain the process and supply some code for the no data event on a report. I want a message box to pop up and say there is no data in the report. Please help me by supplying code for me. Thanks.
 
Go into the OnNoData event and enter this below the sub procedure header.

Msgbox "Sorry, there is no data for this report",0,"No Data Available"

The report will still have to be manually closed though, try entering

Cancel = True

under the Msgbox line and see if that works

Hope this works

Ian
 
You could also set the OnNoData property of the report to a macro.

Have the macro put out the message box, the do a CancelEvent, which automates the cancelling of the print/preview action

If you use VBA approach, set the Cancel argument of the Report_NoData Sub to True. That should close it for the user.
 

Users who are viewing this thread

Back
Top Bottom