Running a series of reports as a unit

  • Thread starter Thread starter Carl Rapson
  • Start date Start date
C

Carl Rapson

I have a set of reports, each based on a different crosstab query, that I
would like to run as a single "unit" -- that is, I would like to somehow run
each report sequentially, combining the output into a single report(
although each report would need to run independently of the others). That
way, the user can view the output of the reports on-screen at one time,
rather than having to cycle through each individual report closing each one
before the next is viewed. Printing is not so much of a problem, although if
I could somehow number the pages sequentially it would help (as it is now,
each report is page 1).

Is something like this possible, maybe making use of subreports? Any
information would be greatly appreciated.

Carl Rapson
 
I have a set of reports, each based on a different crosstab query, that I
would like to run as a single "unit" -- that is, I would like to somehow run
each report sequentially, combining the output into a single report(
although each report would need to run independently of the others). That
way, the user can view the output of the reports on-screen at one time,
rather than having to cycle through each individual report closing each one
before the next is viewed. Printing is not so much of a problem, although if
I could somehow number the pages sequentially it would help (as it is now,
each report is page 1).

Is something like this possible, maybe making use of subreports? Any
information would be greatly appreciated.

Carl Rapson
Carl,
Sub-reports is probably the way to go.

Here is a method to print the reports with consecutive page numbering.

Make a table to hold the last page number of each report.
Table name "tblPage"
All you need is one field:
"intPageNumber" Number datatype, Integer

Next, enter a 0 (Zero) into the field as a starter number.

Now in each report, Dim a variable in the declarations section:

Option Compare Database
Option Explicit
Dim intLastPage as Integer

Code the each report's Open event:
intLastPage = DLookUp("intPageNumber","tblPage")

Code each Report's Report Header Format event:
[Page] = [Page] + intLastPage

Code each Report's Report Footer Print event:
DoCmd.SetWarnings False
DoCmd.RunSQL "Update tblPage Set tblPage.intPageNumber = " & [Page] &
";"
Docmd.SetWarnings True

Each report should pick up the ending page of the previous report and
increment it by 1.
Note: You'll not be able to use the [Pages] property in any of these
reports, i.e. ="Page " & [Page] & " of " & [Pages] as you'll get
something
like "Page 32 of 4".

You must enter a 0 in the table at the start of each batch of reports.
If there is always one same report which is run first in the batch,
just use a RunSQL in the first Report's Open event (before anything
else):

DoCmd.SetWarnings False
DoCmd.RunSQL "Update tblPage Set tblPage.intPageNumber = 0;"
Docmd.SetWarnings True

to reset the field to zero.

If the Reports are in random run order, manually (or otherwise) enter
a 0 into that table field before starting.
 
Fred,

Thanks very much for the insights. I will give it a try.

Carl Rapson

I have a set of reports, each based on a different crosstab query, that I
would like to run as a single "unit" -- that is, I would like to somehow run
each report sequentially, combining the output into a single report(
although each report would need to run independently of the others). That
way, the user can view the output of the reports on-screen at one time,
rather than having to cycle through each individual report closing each one
before the next is viewed. Printing is not so much of a problem, although if
I could somehow number the pages sequentially it would help (as it is now,
each report is page 1).

Is something like this possible, maybe making use of subreports? Any
information would be greatly appreciated.

Carl Rapson
Carl,
Sub-reports is probably the way to go.

Here is a method to print the reports with consecutive page numbering.

Make a table to hold the last page number of each report.
Table name "tblPage"
All you need is one field:
"intPageNumber" Number datatype, Integer

Next, enter a 0 (Zero) into the field as a starter number.

Now in each report, Dim a variable in the declarations section:

Option Compare Database
Option Explicit
Dim intLastPage as Integer

Code the each report's Open event:
intLastPage = DLookUp("intPageNumber","tblPage")

Code each Report's Report Header Format event:
[Page] = [Page] + intLastPage

Code each Report's Report Footer Print event:
DoCmd.SetWarnings False
DoCmd.RunSQL "Update tblPage Set tblPage.intPageNumber = " & [Page] &
";"
Docmd.SetWarnings True

Each report should pick up the ending page of the previous report and
increment it by 1.
Note: You'll not be able to use the [Pages] property in any of these
reports, i.e. ="Page " & [Page] & " of " & [Pages] as you'll get
something
like "Page 32 of 4".

You must enter a 0 in the table at the start of each batch of reports.
If there is always one same report which is run first in the batch,
just use a RunSQL in the first Report's Open event (before anything
else):

DoCmd.SetWarnings False
DoCmd.RunSQL "Update tblPage Set tblPage.intPageNumber = 0;"
Docmd.SetWarnings True

to reset the field to zero.

If the Reports are in random run order, manually (or otherwise) enter
a 0 into that table field before starting.
--
Fred

Please reply only to this newsgroup.
I do not reply to personal e-mail.
 
Back
Top