Opening many reports, new operator & opened tables error

N

Nicolas Weeger

Hello everyone.

Here is my problem: I have data lines that I want to print (nothing
fancy for now :))
Each line has its own report model, stored as a string (report name in
Access).
I want to offer print preview. So, for each line, I open the report, in
print preview, using something like 'myReport = new Report_<reportname>'
in VBA code. But I can't seem to open more than four at the same time.
Trying to open five reports yields the message 'cannot open more tables'.
Note that, since I potentially need to open multiple times the same
report with different data (and merging data to open only once is not an
option), I can't just do a docmd.open to open the report, thus the 'new'.

I applied a Jet patch that enables more tables to be opened, and the
crash frequency (which was high) was reduced a lot. But still I can't
open more than four reports.

My reports are kind of complex: one main report, 7, 20 or 27 subreports,
some with their own subreports - everything linked via master/child
properties. Also, each report uses a table (linked via ODBC to a SQL
server) to fetch its data.

The aim of having a model per line is to let a user change one subreport
somewhere, create a new 'global' report by copying one existing, change
just the new subreport, and update the model name on the line.

Now my issue is, of course, to print preview all those different models
*at the same time*.
(note that for printing it works fine, as I can print line by line, one
report by one report).

I see basically two options:

First, finding a way to open (in print preview) all reports at the same
time. This would be my preferred solution for now, but I'm starting to
think it's impossible.
I tried opening a report and waiting for first detail format to be
completed before opening the next - to no avail (note: since I use
'Pages' property in report, Access will compute all pages before detail
format is called with 'Pages <> 0', thus I wait for that to signal the
end of detail formatting)

Note that previewing line by line is unfortunately not an option :)


Second solution, make a massive report, with different versions of a
same subreport all stacked together, and hiding all except those for the
current line.
Seems pretty ugly, and the maintenance of this report, as subreports are
changed (all version changes will result in a new subreport, as it
should be possible to print any line as it was first printed, over and
over. So losing some subreport's version is not acceptable), will become
a real mess. This could probably be automatized using VBA, but I don't
know how to do that.

I tried, also, to dynamically change subreports during detail format -
but this isn't possible once the report have been opened.


My mandatory working environment is Access 97. I tried converting the
database to Access 2000 to test, and still couldn't open more than four
reports.


So I'm wondering if anyone would have some tips, advice, maybe a third
obvious solution? :)

Many thanks in advance, and sorry if this was a long mail. And if
something is not clear, just say so & i'll try to explain better ^_^


Nicolas Weeger
 

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