Results 1 to 6 of 6
  1. #1
    Star Lounger
    Join Date
    Mar 2002
    Location
    Decatur, AL
    Posts
    53
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Access 2007 Print only 1st page of report

    I've searched the forum for the answer to this, but everything I found required going to Print Preview first.

    I want my form to have a command button that will print only the 1st page of a multi-page report. Is that simply done via Docmd.OpenReport with arguments specified?

    What I found from previous threads that began with preview open is:

    DoCmd.PrintOut PrintRange:=acPages, PageFrom:=1, PageTo:=1

    Seems like this would be easy, maybe I'm just sleep-deprived

    Thanks,
    Kathi

  2. #2
    Super Moderator RetiredGeek's Avatar
    Join Date
    Mar 2004
    Location
    Manning, South Carolina
    Posts
    9,434
    Thanks
    372
    Thanked 1,457 Times in 1,326 Posts
    Kathi,

    Per Microsoft:
    You can use the PrintOut action to print the active object in the open database. You can print datasheets, reports, forms, data access pages, and modules.
    Note the "active object" phrase. Thus you must have the report displayed to use the PrintOut function.
    The DoCmd.OpenReport does not offer the option to select pages. HTH
    May the Forces of good computing be with you!

    RG

    PowerShell & VBA Rule!

    My Systems: Desktop Specs
    Laptop Specs

  3. The Following User Says Thank You to RetiredGeek For This Useful Post:

    ladyengr (2013-07-09)

  4. #3
    Star Lounger
    Join Date
    Mar 2002
    Location
    Decatur, AL
    Posts
    53
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Darn, definitely NOT what I wanted to hear
    Thanks for replying RG

  5. #4
    Star Lounger
    Join Date
    Dec 2009
    Location
    Findlay, Ohio
    Posts
    57
    Thanks
    4
    Thanked 6 Times in 6 Posts
    I found this at another site. I tried and it only printed 1 page of 2 page report on my test.
    Private Sub cmdPrint_Click()
    DoCmd.OpenReport "Name of Report", acViewPreview
    DoCmd.PrintOut acPages, 1, 1
    DoCmd.Close acReport, "Name of Report"
    End Sub

  6. The Following User Says Thank You to orangehat For This Useful Post:

    ladyengr (2013-07-10)

  7. #5
    Star Lounger
    Join Date
    Mar 2002
    Location
    Decatur, AL
    Posts
    53
    Thanks
    2
    Thanked 0 Times in 0 Posts
    PERFECT!!!! Thank you so much orangehat, I am eternally grateful.

  8. #6
    Star Lounger
    Join Date
    Dec 2009
    Location
    Findlay, Ohio
    Posts
    57
    Thanks
    4
    Thanked 6 Times in 6 Posts
    Glad to be of help!

Posting Permissions

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