Exiting a report using VBA

J

John Baker

Is it possible to exit a report from one of the events of the report?

I have a call to a subprocedure from the report_open event. Depending on
certain values in the subprocedure I would like to be able to end the
report. I tried to do this with a docmd.close command but it wont let me
exit at this point.

Any help greatly appreciated.

John Baker
(e-mail address removed)
 
A

Allen Browne

The Report_Open event has a Cancel argument.

Just set that to True to cancel loading the report:
Cancel = True

Note that the report data is not present at this time.
 

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