Results 1 to 3 of 3
  1. #1
    SierraJuliet's Avatar
    SierraJuliet is offline Competent Performer
    Windows 7 64bit Access 2013 64bit
    Join Date
    Dec 2017
    Location
    Earth
    Posts
    211

    Print Reports as PDF

    I am interesting to know how to print to a PDF instead of printing to the printer.



    The following code prints report to printer, what modifications are necessary to print to PDF.

    Code:
    DoCmd.OpenReport "rptPrintInvoiceInfo", acViewNormal, , "[InvoiceNum] = """ & Me![txtInvoiceNum] & """"

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,524
    (make the query in the report look at the form object for the key)

    vFile = "c:\my documents\MyFile.pdf

    docmd.OutputTo acOutputReport ,"rMyReport",acFormatPDF,vFile

  3. #3
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    You could also do:

    DoCmd.OpenReport "rptPrintInvoiceInfo", acViewPreview, , "[InvoiceNum] = """ & Me![txtInvoiceNum] & """"
    DoCmd.OutputTo ...
    DoCmd.Close...

    with the last line closing the report. You can open the report hidden if the flicker bothers you.
    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: 2
    Last Post: 02-15-2015, 11:36 AM
  2. Reports only print once
    By Perceptus in forum Reports
    Replies: 3
    Last Post: 10-02-2014, 10:10 AM
  3. Replies: 11
    Last Post: 07-16-2014, 08:37 AM
  4. Reports print Twice
    By brharrii in forum Reports
    Replies: 5
    Last Post: 10-31-2012, 02:22 PM
  5. Print different Reports at once
    By Brian62 in forum Reports
    Replies: 5
    Last Post: 01-21-2011, 11:19 AM

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