I posted this the other day and got a great suggestion. It's been so long since I've coded that I am messing something up. When I go into general Declarations and add Globabl Page number (See Below) the text turns Red. I inserted the function below (Also in the General declarations) and I added a text box in the footer of my reports with the caption property set to the code below. For some reason I get (Name?) in the text box in preview mode. Can anyone fill in the blanks for me here?
mrblonde (TechnicalUser) Mar 16, 2001
Hello,
I have Access 2000. I am creating a set up that will run about 6 reports, each 1-3 pages long. I'd like to have a macro run this, which I know how to do. However, I don't know how to keep the page numbers going. What I mean is Report 1 would run, using pages 1,2,3, and 4. How do I get Report 2 to automatically start at 5?
DougP (MIS) Mar 17, 2001
1st leave off the Pager numbers on all reports
If you create a function that is called from the bottom of each page and store a "Pagenumber" in a global variable it will keep a count for you
----------------- put this in a module -------------
Option Compare Database
Option Explicit
Global PageNumber
------------------ Create this new function
Public Function CountPages()
PageNumber = PageNumber + 1
CountPages = PageNumber
End Function
---------------------- Call it from your report
I put it in the Page footer
="Page " & CountPages()
DougP, MCP
MichaelRed (Programmer) Mar 17, 2001
Also, you would need some way to set PageNumber to 1 at the start of the reporting process (also need to do this to re-run a set of reports)
MichaelRed
redmsp@erols.com
mrblonde (TechnicalUser) Mar 16, 2001
Hello,
I have Access 2000. I am creating a set up that will run about 6 reports, each 1-3 pages long. I'd like to have a macro run this, which I know how to do. However, I don't know how to keep the page numbers going. What I mean is Report 1 would run, using pages 1,2,3, and 4. How do I get Report 2 to automatically start at 5?
DougP (MIS) Mar 17, 2001
1st leave off the Pager numbers on all reports
If you create a function that is called from the bottom of each page and store a "Pagenumber" in a global variable it will keep a count for you
----------------- put this in a module -------------
Option Compare Database
Option Explicit
Global PageNumber
------------------ Create this new function
Public Function CountPages()
PageNumber = PageNumber + 1
CountPages = PageNumber
End Function
---------------------- Call it from your report
I put it in the Page footer
="Page " & CountPages()
DougP, MCP
MichaelRed (Programmer) Mar 17, 2001
Also, you would need some way to set PageNumber to 1 at the start of the reporting process (also need to do this to re-run a set of reports)
MichaelRed
redmsp@erols.com