Page Number Needed in Report Header

I need to create a page number in a report header.

I wrote a function to calculate a number, however I do not know how to associate this with a new page event. How can this be handled and is there an easier way

Here is my simple function:

Public Function getPageNumber(ByRef iPageNo As Integer) As Integer
Dim iNo as Integer
iNo = iNo + 1
Return iNo
End Function

Thanks,

cj



Answer this question

Page Number Needed in Report Header

  • avrilsim

    You can put the page number into a report header without using custom code.

    Drop a textbox into the report header and use this expression:

    =Globals!PageNumber

    -Chris



  • arindam_

    I don't think that will work because the "=Globals!PageNumber" only works in the Page Header, not the Report Header, correct

    I get this error:

    The value expression for the textbox ‘textbox97’ refers to the global variable PageNumber or TotalPages. These global variables can be used only in the page header and page footer.

    ~cj


  • Page Number Needed in Report Header