Print preview reports in a VBA loop?

M

Margaret Bartley

My VBA module prints out 18 versions of the same report, with a different
record source each time.

I can't figure out how to get the code to stop and let the user look the
report, print it out if required, and then continue to the next version.

I tried putting in a msgbox function ("Do you want to print the report?",
vbYesNo), but that did not allow the user to select the report, and print
it, all it did was allow the user to click the msgbox button, and continue
the loop.

When the loop continues, it just replaces each report with the new one, so
the only way to see the first 17 reports is to send them to the printer,
which is a really embarrassing thing to have to say.

Any help?

TIA,
Margaret
 
G

Guest

You could change your approach by creating a form with 2 buttons, "Previous"
and "Next",

Each button will do the following:
-Close the report if is open
-Decrement (Previous) or increment (Next) the current report number (1 to
18) and move only between 1 and 18
-Open the report in print preview with the source needed (1-18)
-The user will decide to print, close, or select previous or next report to
preview; you can also put a message in your form indicating what the current
report is,
 

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