Results 1 to 4 of 4
  1. #1
    3 Star Lounger
    Join Date
    Dec 2000
    Location
    Manassas, Virginia, USA
    Posts
    363
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Start printing at specific Page (2000/XP)

    I have a report that prints over 2000 pages. If the printer malfunctions and it is determined that the last page that printed correctly was page 467. If I provide the user a text box entitled NumPage to enter the page number where they want printing to begin, how can I code the button that prints the report to begin printing on page 1 if NumPage is null and begin at the page number the user enters if it is not null.
    Judy Jones, Computer Training Specialist
    Manassas, Virginia

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

    Re: Start printing at specific Page (2000/XP)

    You can use code like this in the On Click event of the command button:

    ' Select the report in the database window
    DoCmd.SelectObject acReport, "rptSomething", True
    ' Start printing at page specified in NumPage
    If IsNull(Me.NumPage) Then
    Me.NumPage = 1
    End If
    DoCmd.PrintOut acPages, Me.NumPage, Me.NumPage + 10000

    (it doesn't hurt to specify a non-existing last page)

  3. #3
    3 Star Lounger
    Join Date
    Dec 2000
    Location
    Manassas, Virginia, USA
    Posts
    363
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Start printing at specific Page (2000/XP)

    I typed the code as follows. When it ran I didn't get any error message but it didn't do anything.

    DoCmd.SelectObject acReport, "rptLetter2Parent", True
    If IsNull(Me.NumPage) Then
    Me.NumPage = 1
    End If
    DoCmd.PrintOut acPages, Me.NumPage, Me.NumPage + 10000
    Judy Jones, Computer Training Specialist
    Manassas, Virginia

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

    Re: Start printing at specific Page (2000/XP)

    Judy,

    The code I posted relies on selecting the report in the database window. If your form has Modal and/or Popup set to Yes, or has been opened with WindowMode set to acDialog, that will probably fail. I tested it from a "standard" form and it worked fine then.

Posting Permissions

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