Multiple instances of Previewing the same report

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a situation where I have a similar report layout, but various
criteria. I want to be able to consolidate my reports so that I have a
'shell' report that can have different recordsources.

If I have the same report called twice, but with two different
recordsources, how can I be able to view both instances in Preview mode? or
can I not do this?

Thanks
 
You can open multiple instances of a report in Preview mode with the New
keyword.

Unlike OpenReport, that approach does not have a WhereCondition, so you must
use the Open event of the report if you want the different instances to show
different data.

Unfortunately, Micorosft messed up the filtering of reports, so when you try
to set the Filter of one instance the results are unreliable, i.e. it
sometimes fails to apply the Filter, or it can even apply the Filter to the
wrong instance.

You may be able to work around that by saving the report as unbound, and
setting its RecordSource in Report_Open.

Next, there is the issue of managing the multiple instances independently of
each other, which means keeping the Report variable created by the New
keyword from going out of scope until you intend it to. The simplest way to
do that is with a custom collection. There is a downloadable example of how
to do that for forms in this link:
Managing Multiple Instances of a Form
at:
http://allenbrowne.com/ser-35.html
 
Back
Top