Results 1 to 3 of 3
  1. #1
    Star Lounger
    Join Date
    Mar 2001
    Posts
    56
    Thanks
    0
    Thanked 0 Times in 0 Posts

    page numberin on reports (Access XP)

    I need to change the starting page number on a report. I would like to have a parameter dialogue box open up when I open the report (as the starting page number will change at different printing periods) and ask me what page number I would like to start with. Is this possible? If not is there a better way of doing this. Thanks. Dorothy

  2. #2
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: page numberin on reports (Access XP)

    Open the report in design view.
    Go to the VBE window (ALT-F11)
    At the top of the module, enter :
    Option Compare Database
    Option Explicit
    Dim NewPage As Integer

    In the On Open event of the report enter :
    Private Sub Report_Open(Cancel As Integer)
    NewPage = InputBox("What page number do you want to start ?", "Page Number", 1)
    End Sub

    In the On Format event of the Page Footer section enter :
    Private Sub PageFooter_Format(Cancel As Integer, FormatCount As Integer)
    If Page = 1 Then
    Page = NewPage
    End If
    End Sub
    Francois

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

    Re: page numberin on reports (Access XP)

    That will work well, but if the user clears the input box or enters an invalid number, you'd get an error mesage. To avoid this, I would use

    NewPage = Val(InputBox("What page number do you want to start ?", "Page Number", 1))

Posting Permissions

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