Recognizing when a Print Preview window closes

  • Thread starter Thread starter Becky
  • Start date Start date
B

Becky

hello gurus
I have a loop that has a statement:
DoCmd.OpenReport strDocName, acViewPreview

The report (it is called rptAreaSummary) appears as expected in its own
window. I want code to stop execution in the loop until the current report
preview window is closed. Then the loop should continue executing. How can
this be done?

thanks for any advice
Becky
 
Becky said:
hello gurus
I have a loop that has a statement:
DoCmd.OpenReport strDocName, acViewPreview

The report (it is called rptAreaSummary) appears as expected in its own
window. I want code to stop execution in the loop until the current
report
preview window is closed. Then the loop should continue executing. How
can
this be done?


What version of Access? In (at least) recent versions, the DoCmd.OpenReport
method has a WindowMode argument that can be used to open the report in
dialog mode, in which case the code will automatically pause while the
report's preview window is open, and only resume after the window is closed
or hidden.

DoCmd.OpenReport strDocName,acViewPreview, _
WindowMode:=acDialog
 
Dirk - that was it perfectly!

I'd looked all through VBA help, but I often seem to have trouble finding
things there. The Answer Wizard draws a blank for acWindowMode, acDialog,
WindowMode.....etc.

Thanks again - Becky
 

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