Results 1 to 7 of 7
  1. #1
    Star Lounger
    Join Date
    Mar 2002
    Location
    Haaltert, Belgium
    Posts
    84
    Thanks
    0
    Thanked 0 Times in 0 Posts

    restart page number counting on group (2007)

    When I do a preview of a report that contains different records; I want that the page number counting restart when the the pageheader is an other record.
    Now the page numbers goes from 1 to ..... wihtout restart counting page numbers.
    Does some has done this before?

  2. Get our unique weekly Newsletter with tips and techniques, how to's and critical updates on Windows 7, Windows 8, Windows XP, Firefox, Internet Explorer, Google, etc. Join our 480,000 subscribers!

    Excel 2013: The Missing Manual

    + Get this BONUS — free!

    Get the most of Excel! Learn about new features, basics of creating a new spreadsheet and using the infamous Ribbon in the first chapter of Excel 2013: The Missing Manual - Subscribe and download Chapter 1 for free!

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

    Re: restart page number counting on group (2007)

    The instructions below are for Access 2003 and earlier versions, it will no doubt be slightly different for Access 2007.

    Do you really want to restart page numbering at 1 for each record? If so:

    - Open the report in design view.
    - Click on the gray bar at the top of the Detail section.
    - Activate the Properties window.
    - Activate the Format tab.
    - Make sure that the Force New Page property is set to Before Section.
    - Activate the Event tab.
    - Create an event procedure for the On Format event:

    Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
    Me.Page = 1
    End Sub

    - The name of the Detail section might be different.
    If you group the report on some field and want to restart numbering at 1 for each group, do the same as above for the group header section instead of for the detail section.

  4. #3
    Star Lounger
    Join Date
    Mar 2002
    Location
    Haaltert, Belgium
    Posts
    84
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: restart page number counting on group (2007)

    That works just fine, even in 2007 :-)

  5. #4
    3 Star Lounger
    Join Date
    Oct 2004
    Location
    Houston, Texas, USA
    Posts
    242
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: restart page number counting on group (2007)

    This works great! However, I also would like to have a total number of pages for the group, to show page x of y for each group, with y being the total number of pages in the group.
    Is there a way to do so?
    Thanks,

    itconc

  6. #5
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 16 Times in 16 Posts

    Re: restart page number counting on group (2007)

    This is more complicated, because you have to store the number of pages in each group somewhere. MSKB article How to reset the page number and the total page count for each group in a Microsoft Access report explains how to do this; it uses a table to store the number of pages per group.

  7. #6
    3 Star Lounger
    Join Date
    Oct 2004
    Location
    Houston, Texas, USA
    Posts
    242
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: restart page number counting on group (2007)

    Thanks Hans - that worked. Al ittle awkward if you have multiple reports though.

  8. #7
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 16 Times in 16 Posts

    Re: restart page number counting on group (2007)

    The attached database shows a different approach based on Reports: Printing First and Last Page Numbers for Report Groups on the Access Web.
    It uses two arrays that are private to the report instead of a table, so you can use the code in multiple reports (you'll have to adjust the field name in the code, strCategoryName in the example).
    Attached Files Attached Files

Posting Permissions

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