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!