Multiple report formats

G

Guest

I have several separate reports in various formats based on different tables
and queries and these reports are all related from the perspective of
management users. How can I combine these reports into one report so that
all are printed together, preferably with consecutive page numbers, titles,
etc.? I can easily go through the report wizard and create each one but
putting them together in this fashion is something I'm having trouble
figuring out how to do.

Thanks in advance
 
R

Rick Brandt

Glenn Suggs said:
I have several separate reports in various formats based on different tables
and queries and these reports are all related from the perspective of
management users. How can I combine these reports into one report so that
all are printed together, preferably with consecutive page numbers, titles,
etc.? I can easily go through the report wizard and create each one but
putting them together in this fashion is something I'm having trouble
figuring out how to do.

One way...

DoCmd.OpenReport "Report1"
DoCmd.OpenReport "Report2"
etc..

Now; create a public variable in a standard module and in the Page event of each
page in all reports have a line of code...

VariableName = VariableName + 1

In the Open event of all of the reports except for the first have a line of
code...

Me.Page = VariableName

I'm not sure if I've listed the best events here but the point is that you can
programmatically set the value for the [Page] property in a report and then it
will count up from that as a new starting point. So if your first report had
three pages the second report would number its first page as page 4 and so on.

You would likely want an event in the first report to reset the variable back to
zero in case you print the batch more than once in a session.
 
G

Guest

Rick, Thanks for the input. It seems putting Me.Page = VariableName in the
open event doesn't set the first page number of each report but putting it in
the Activate event does. However, the page number in that case are mixed up
among the various reports. i.e...
report 1 has pages 1, 2
report 2 has pages 2, 9
report 3 has page 3
report 4 has page 4
report 5 has pages 5, 7, 8
report 6 has page 6

It as if each report starts before the last one finishes, resets the page
number, and then each continues with the next available sequence number. Can
you help?
--
Glenn


Rick Brandt said:
Glenn Suggs said:
I have several separate reports in various formats based on different tables
and queries and these reports are all related from the perspective of
management users. How can I combine these reports into one report so that
all are printed together, preferably with consecutive page numbers, titles,
etc.? I can easily go through the report wizard and create each one but
putting them together in this fashion is something I'm having trouble
figuring out how to do.

One way...

DoCmd.OpenReport "Report1"
DoCmd.OpenReport "Report2"
etc..

Now; create a public variable in a standard module and in the Page event of each
page in all reports have a line of code...

VariableName = VariableName + 1

In the Open event of all of the reports except for the first have a line of
code...

Me.Page = VariableName

I'm not sure if I've listed the best events here but the point is that you can
programmatically set the value for the [Page] property in a report and then it
will count up from that as a new starting point. So if your first report had
three pages the second report would number its first page as page 4 and so on.

You would likely want an event in the first report to reset the variable back to
zero in case you print the batch more than once in a session.
 
R

Rick Brandt

Glenn Suggs said:
Rick, Thanks for the input. It seems putting Me.Page = VariableName in the
open event doesn't set the first page number of each report but putting it in
the Activate event does. However, the page number in that case are mixed up
among the various reports. i.e...
report 1 has pages 1, 2
report 2 has pages 2, 9
report 3 has page 3
report 4 has page 4
report 5 has pages 5, 7, 8
report 6 has page 6

It as if each report starts before the last one finishes, resets the page
number, and then each continues with the next available sequence number. Can
you help?

You might have to use OpenReport only for the first report in your original code
and then have each report open the next in its Close event. That should ensure
that one is finished before the next one begins.
 
G

Guest

When I open each report in the previous report's Close event, it works fine
as long as I run them in Preview mode. But when running in Print mode,
acViewNormal, only the first one runs. Is the Close event supposed to fire
when the a report is finished printing to the printer? It appears not.

Thanks
 
R

Rick Brandt

Glenn said:
When I open each report in the previous report's Close event, it
works fine as long as I run them in Preview mode. But when running
in Print mode, acViewNormal, only the first one runs. Is the Close
event supposed to fire when the a report is finished printing to the
printer? It appears not.

Might have to experiment with different events. Try the OnPrint of the
report footer. Even if the first report isn't "done" in that event it
should at least be at its last page.
 

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