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!

Empty Report Message?

Status
Not open for further replies.

mrf1xa

Technical User
Jan 14, 2002
366
GB
I have a cost/benefit report for which the user selects the month from a form before opening the report- no problem.
What I would like to do is to check whether there is any data present for the chosen month, before the report is opened, and if there is none display a message box saying this instead. What's the easiest way to go around this please?

Thanks

Nigel
 
On the report form, check out the NoData Event. What I typically do is create a Macro (even though I try to avoid them) with 2 items: MessageBox(with your message) and a CancelEvent. Another approach, I've also done is to do a simple DCount() on the table/query used to see if any records are returned. These are a couple of options, I am sure there are others... htwh... Steve Medvid
"IT Consultant & Web Master"
web page under development...
 
Thanks for both responses- Steve's suggestion works a treat and will no doubt find its way into many more of my applications over time.

Nigel
 
Please advise where the NoData Event is located. I dont have one.
Do I need to create one??
 
The NoData Event is located on the Report Form. Open the Report form, select properties. Next, press the Events tab and there it will be... Steve Medvid
"IT Consultant & Web Master"
web page under development...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top