close report when there is no data to display

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

What code would I use to automatically close a report that has no data? I
have played around with the 'on no data' code but am not good enough yet to
get it to work.

Please help!
 
BLTibbs said:
What code would I use to automatically close a report that has no data? I
have played around with the 'on no data' code but am not good enough yet to
get it to work.


The NoData event procedure only needs the one line:
Cancel = True
between the Sub and End Sub statements.

Don't confuse the OnNoData property with the NoData event
procedure, The OnNoData property must be set to
[Event Procedure]

After you get that working, you will receive a message box
stating that the report was cancelled. If you are opening
the report from a form button's Click event, you can
suppress the message by ignoring error number 2501. Post
back with the code for the button's procedure if you need
help straightening this out.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top