Results 1 to 4 of 4
  1. #1
    ifthenelsenull is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2013
    Posts
    2

    Using a macro to print a report without a printer prompt

    I have this macro built in Access 2010 which will open a report and prompt for a printer selection. I have it defaulted in the report so I want to skip the printer prompt but can't figure out how to do it.

    Code:
    Function OpenReport()
    
    On Error GoTo OpenReport_Err
    
    DoCmd.OpenReport "Results", acViewReport, "", "", acNormal
    DoCmd.RunCommand acCmdPrintPreview
    DoCmd.RunCommand acCmdPrintSelection
    DoCmd.RunCommand acCmdCloseDatabase
    
    OpenReport_Exit: Exit Function
    
    OpenReport_Err: MsgBox Error$ Resume OpenReport_Exit
    
    End Function
    
    In 2007 there was a print option that did automatically print with no prompt but I can't figure out how exactly to recreate it.



    Any help you can provide would be great thanks.

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,525
    Well, this line by itself would print to the default printer (or specified printer):


    DoCmd.OpenReport "Results", , "", "", acNormal
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    ifthenelsenull is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2013
    Posts
    2
    Thank you for the help. That worked perfectly.

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,525
    No problemo.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 6
    Last Post: 09-12-2013, 05:38 PM
  2. Replies: 15
    Last Post: 09-06-2012, 06:25 PM
  3. Replies: 2
    Last Post: 05-05-2012, 02:34 AM
  4. Setting Printer when Printing Report
    By russ0670 in forum Reports
    Replies: 3
    Last Post: 05-12-2010, 09:45 AM
  5. Can docmd.openreport print X copies on Y printer?
    By Coolpapabell in forum Reports
    Replies: 1
    Last Post: 09-02-2009, 08:35 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums