Printing Report without Opening it

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dawn123
    New Member
    • Nov 2009
    • 15

    Printing Report without Opening it

    I have a form that has 5 check boxes as well as two buttons, a preview and a print button. Each checkbox corresponds to a different report. I have the preview button working fine, whatever checkbox is select the report will open showing the user. However when I'm selecing the print button I can get the correct report to print fine but I have to open the report and preview it then it will print. I would like to be able to not even open the report and just print it. I tired the following code:
    Code:
    DoCmd.OpenReport "BlockStatusRegion4",  acViewPreview, "", "", acHidden
    DoCmd.PrintOut acPrintAll
    DoCmd.Close acReport, "BlockStatusRegion4"
    However it just prints the form that the user selects becasue that is what is displayed. Im not sure how to go about doing this so any help would be great.
    Last edited by NeoPa; Aug 26 '10, 01:18 PM. Reason: Please use the [CODE] tags provided
  • Darren McDonald
    New Member
    • Aug 2010
    • 7

    #2
    remove the acViewPreview and it wil default to print. Problem is it will print to the default printer set by access and maybe not the one the current computer has?

    Comment

    • dawn123
      New Member
      • Nov 2009
      • 15

      #3
      Thanks for the help! I was wondering if you knew if it was possible, when you are export a report to PDF in access 2007 that you could specify the number of pages of the report you want to print. (ie. of a 5 page report only print pages 1-3) I know how to do it manually by going into the Options of the export to PDF but I can seem to find how to do it through vba.

      Comment

      Working...