Results 1 to 5 of 5
  1. #1
    2 Star Lounger
    Join Date
    Feb 2003
    Location
    Warwick, Warwickshire, England
    Posts
    189
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Page numbers within Group Header (2003)

    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?

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Page numbers within Group Header (2003)

    See <post#=496,205>post 496,205</post#>.

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

  3. #3
    2 Star Lounger
    Join Date
    Feb 2003
    Location
    Warwick, Warwickshire, England
    Posts
    189
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Page numbers within Group Header (2003)

    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

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Page numbers within Group Header (2003)

    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.

  5. #5
    3 Star Lounger
    Join Date
    Jun 2001
    Location
    Salem, Oregon, USA
    Posts
    219
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Page numbers within Group Header (2003)

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •