Previewing multiple reports

K

KarenH

I am, through code behind a form, attempting to open multiple reports in
preview form. This is the same namedreport, but it is being passed business
unit IDs, so that it will (hopefully) preview a report for each of the
business units selected.

The code I have is:

For Each varCounter In lstSelectReport.ItemsSelected
DoCmd.OpenReport strReportNameSelected, acViewPreview, , "BusUnit =
'" & lstSelectReport.ItemData(varCounter)) & "'"
Next

It preview the first one fine, and I can watch it loop through the docmd
statement for each of the next without error -- but it won't preview them.
Interestingly enough, if I change acViewPreview to acViewNormal, it will
PRINT them all -- but not preview them all.

Is this not possible? Thanks in advance.
 
B

Bob Miller

Try putting a MsgBox that asks you to continue and a DoCmd that close
the report after that before your Next statement .
You can't open two instances of the same object in Access (Table
query, etc.)
The DoCmd.OpenReport is basically the same as double clicking th
report.
 
Top