Results 1 to 3 of 3
  1. #1
    New Lounger
    Join Date
    Oct 2003
    Location
    West Yorkshire, England
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Page numbers (Access 2000)

    Please could someone tell me how to re set the page numbers on a report so that each group starts at page 1.

    Thanks

    Dan

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

    Re: Page numbers (Access 2000)

    Create an On Format event procedure for the group header:

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

    where GroupHeaderName is the name of the group header.

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

    Re: Page numbers (Access 2000)

    Addition to previous reply: if you repeat group headers on each page (Repeat Section property set to Yes), you need a bit of additional code to prevent the page number being reset on every page. You must have a group footer for this; it may have Height = 0.

    ' Variable to signal new section
    Private fNew As Boolean

    Private Sub GroupFooter_Format(Cancel As Integer, FormatCount As Integer)
    ' There's going to be a new section!
    fNew = True
    End Sub

    Private Sub GroupHeader_Format(Cancel As Integer, FormatCount As Integer)
    ' Reset page number if new section
    If fNew Then Page = 1
    ' Toggle flag off
    fNew = False
    End Sub

Posting Permissions

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