• Page numbers within Group Header (2003)

    Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » Page numbers within Group Header (2003)

    Author
    Topic
    #441485

    If I use =[Page] & ” of ” & [Pages] in a report, I can get Page 1 of 4…….Page 2 of 4….etc through a complete report.

    However, I have a report which has a group header in it and I would like the page numbers to initialise within each group

    e.g.

    Group 1
    Page 1 of 2
    Page 2 of 2

    Group 2
    Page 1 of 1

    Group 3
    Page 1 of 4
    Page 2 of 4
    Page 3 of 4
    Page 4 of 4

    Any simple means of doing this?

    Viewing 0 reply threads
    Author
    Replies
    • #1060259

      See post 496,205.

      Added: this is based on Printing First and Last Page Numbers for Report Groups on the Access web.

      • #1061138

        Thanks Hans, I obviously didn’t look far enough back when I was searching for previous posts.

        One thing I did find with your solution was that if I didn’t include the field containing “Page x of y in Report” then the ‘ctlGrpPages’ field wouldn’t display. I just made the “Page x of y in Report” invisible as I don’t need it, but I couldn’t find any reason why it wouldn’t work with this removed.

        John

        • #1061140

          That is because the “y” in “Page x of y in Report” forces Access to calculate the total number of pages in the report when the report is opened, instead of waiting until the last page has actually been rendered.

      • #1087422

        Thank you, Hans! once again, you saved the day. As soon as I realized from the link you inserted that pages() was 0 until after the first pass, then, I was just able to check for “if pages() = 0” and prevent some code I had tussled with for a couple of hours here, to get it to work! I only allowed the “lePage” fake page accumulator to run if pages() was more than 0, and it worked. Wow! thx, Pat

    Viewing 0 reply threads
    Reply To: Page numbers within Group Header (2003)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: