No data Event

G

Guest

I have some audit type reports that look for data that does not seem
consistent. That is e.g. sold=yes but $ rec'd=0. Most of the time those
reports are blank, which is what we want. I have a msg that pops to say that,
no problems found kind of thing, but the report shows in print preview
anyway. I tried to get the macro to close it but it can't because the report
is till running when my msg. box pops up(??). And if i use cancel the event
the whole macro stops but there are more reports to run.

I would like the msg. box to come up, the user clicks OK and the next report
runs and if no data user clicks OK and goes on to the next, etc.
 
F

fredg

I have some audit type reports that look for data that does not seem
consistent. That is e.g. sold=yes but $ rec'd=0. Most of the time those
reports are blank, which is what we want. I have a msg that pops to say that,
no problems found kind of thing, but the report shows in print preview
anyway. I tried to get the macro to close it but it can't because the report
is till running when my msg. box pops up(??). And if i use cancel the event
the whole macro stops but there are more reports to run.

I would like the msg. box to come up, the user clicks OK and the next report
runs and if no data user clicks OK and goes on to the next, etc.

Code the Report OnNoData event
MsgBox "Nothing to report"
Cancel = true

Only that report will be cancelled.

This may cause an error 2501 which should be trapped in the Form's
code event that opened the report. Unfortunately, if you are using a
Macro to open the reports, Macro's do not support error handling.
Perhaps you should switch to code.
 

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

Top