• Access 2007 Print only 1st page of report

    Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » Access 2007 Print only 1st page of report

    Author
    Topic
    #490016

    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

    Viewing 4 reply threads
    Author
    Replies
    • #1400344

      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 :cheers:

      May the Forces of good computing be with you!

      RG

      PowerShell & VBA Rule!
      Computer Specs

    • #1400347

      Darn, definitely NOT what I wanted to hear 🙁
      Thanks for replying RG

    • #1400417

      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

    • #1400420

      PERFECT!!!! Thank you so much orangehat, I am eternally grateful.

    • #1400787

      Glad to be of help!

    Viewing 4 reply threads
    Reply To: Access 2007 Print only 1st page of report

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: