Macro to print multiple reports

S

Shannon Webb

Hi there,

I have an Access 2000 DB with one main form and 80+ reports. I want the
user to be able to click a button and print out all the individual reports
in one shot. Is there any code I can use in the button's OnClick event so
it will print all the database's reports *without* having to create a
monster macro?

Thanks.
 
S

Steve Schapel

Shannon,

I am 99.99% certain that it will be much easier to just have one
report with an appropriate grouping set up to cover the data for all
80+ categories.

However, if you want to do them individually, I am afraid the best
option is a macro with 80+ OpenReport actions one after the other, one
for each report. There are various other ways, but in my opinion
these would not be worth the trouble, as your macro with the 80+
OpenReport actions could be created via Copy/Paste and then edit the
report names, in just a few minutes. However, for the record, one
such option would be to put an unbound textbox on the form, with its
Default Value set to 1, name your reports Report1, Report2 etc, make a
simple macro with 2 actions, OpenReport and SetValue, the latter to
increment the value of the unbound textbox by 1, and then make another
macro with the RunMacro action, to run the first macro, and in the
RepeatCount argument put the number of reports.

There are ways to do the equivalent kind of thing in a VBA procedure
as well. Once again, this would depend on the reports having names
that include a number or letter identifier which can be incremented.

But in the end, as I said before, there is an easier way.

- Steve Schapel, Microsoft Access MVP
 

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