Code to place page number text on report 
Author Message
 Code to place page number text on report

I've written a function called PageStamp() that I can use on all reports to
place the text "Page 1 of 4" on the report. I created a module for this so
it would be available to all reports. The function I came up with is:

Function strPageStamp (intTotalPgs As Integer) As String
          strPageStamp = "Page " & Screen.Activereport.Page & " of " & intTotalPgs
End Function

In the text box control source I type =PageStamp([Pages])

This function works as long as the report is in print preview. If I send a
report off from a command button I get an error telling me that no report
is active. I've tried every way I can think of to pull this off and every
variation has its own shortcoming. If anyone has a suggestion, I would
appreciate the help!



Mon, 16 Aug 1999 03:00:00 GMT  
 Code to place page number text on report

   The Screen object is only active when the report is displayed on the
screen.   Try the modifications below and see if they work for you.
Essentially, just pass in the report's name so you don't have to use the
Screen object.  I don't know that this will work, it's just a suggestion.

Charles E. Robinson


Quote:
> I've written a function called PageStamp() that I can use on all reports
to
> place the text "Page 1 of 4" on the report. I created a module for this
so
> it would be available to all reports. The function I came up with is:

 Function strPageStamp (intTotalPgs As Integer, strReportName As String) As
String
          strPageStamp = "Page " & Reports(strReportName).Page & " of " &
intTotalPgs
 End Function
 In the text box control source I type =PageStamp([Pages, Me.Name])
Quote:

> This function works as long as the report is in print preview. If I send
a
> report off from a command button I get an error telling me that no report
> is active. I've tried every way I can think of to pull this off and every
> variation has its own shortcoming. If anyone has a suggestion, I would
> appreciate the help!




Mon, 16 Aug 1999 03:00:00 GMT  
 Code to place page number text on report

Quote:
>This function works as long as the report is in print preview. If I send a
>report off from a command button I get an error telling me that no report
>is active. I've tried every way I can think of to pull this off and every
>variation has its own shortcoming.

Add a report reference argument to your function rather than using
Screen.ActiveReport:

Function strPageStamp (Rpt as Report) As String
          strPageStamp = "Page " & Rpt.Page & " of " & Rpt.Pages
End Function

    ...Joe Maki
    MT Kupp & Associates



Tue, 17 Aug 1999 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Getting the number of decimal places from a number

2. Exporting a 3 decimal number to text file produces trunc 2 decimal text number

3. How to Reset the Pages Number on Group Level in a Report

4. Page Numbering for grouped reports

5. Consecutive page numbers on multiple reports

6. Page number problem in Access 2 reports!

7. return the page number from a report

8. Pausing Access Reports based on page numbers

9. Text in page number

10. MS Access Report Page Numbers

11. How to check number of page in Crystal Report

12. Page number in a Cross Tab report

 

 
Powered by phpBB® Forum Software