Consecutive Page Numbers across different Reports

A

Axess08

Hello all;

I have several reports that I would like to print out all together and have
the page numbers print in consecutive order in the report footer. (i.e.
Report 1 = pages 1, 2,3 and Report 2 = pages 4, 5, 6, etc.) I have set up a
command button that prints all of the reports consecutively, but of course
the page numbers are not consecutive. I could just easily manually set the
page footer for each report to start where the other report ends, however, if
I should change the previous report size for some reason, i would like to to
be automatically change to reflect the correct pages. I tried to use Fred's
suggestion about page numbers, but I am not getting any page numbers to show
up. Here is the code that fredg suggested:

Created a Table named: "tblPage"
Only 1 field: "intPageNumber" Number (datatype), Integer
0 was entered as a starting value in the table

In Report 1 and 2:

Option Compare Database
Option Explicit
Dim intLastPage As Integer

Private Sub PageFooterSection_Print(Cancel As Integer, PrintCount As Integer)
DoCmd.SetWarnings False
DoCmd.RunSQL "Update tblPage Set tblPage.intPageNumber = " & [Page] & ";"
DoCmd.SetWarnings True

End Sub

Private Sub PageHeaderSection_Format(Cancel As Integer, FormatCount As
Integer)
[Page] = [Page] + intLastPage

End Sub

Private Sub Report_Open(Cancel As Integer)
intLastPage = DLookup("intPageNumber", "tblPage")

End Sub


I even tried his suggestion of adding in Report 1 the following in the
Report's Open Event:
DoCmd.SetWarningsFalse
DoCmd.RunSQL "Update tblPage Set tblPage.intPageNumber = 0;"
DoCmd.SetWarnings True

It hasn't worked yet. Of course Access isn't telling me that there is
something wrong with the code, it just isn't putting up page numbers. Can
anyone tell me what it is that I am doing wrong?

(Oh and thanks to fredg from his earlier reply to Mark Haley)
 

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