Results 1 to 4 of 4
  1. #1
    jgelpi16 is offline Expert
    Windows XP Access 2007
    Join Date
    Mar 2010
    Location
    Charlotte, NC
    Posts
    544

    Question Export to .pdf with default name

    I would like to export a report to PDF format. However, I don't want to use the report name as the default file name. Is it possible to do that?



    Report Name: Report1
    Desired .pdf name: PDFFile

    Here is the code I am using, but when you do save it the file name defaults to Report1

    Code:
        DoCmd.OutputTo acOutputReport, "Report1", "PDF Format (*.pdf)", "", False, "", 0, acExportQualityPrint
    Thank you!

  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,521
    You can specify the name in the output file argument. Here's an example:

    DoCmd.OutputTo acOutputReport, "rptBooking", acFormatPDF, GetBEFolder("tblbookings") & strFileName & ".pdf"

    That uses a function to find the path and a variable for the name (strFileNam).
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    jgelpi16 is offline Expert
    Windows XP Access 2007
    Join Date
    Mar 2010
    Location
    Charlotte, NC
    Posts
    544
    Perfect. Thank you!

  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,521
    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. default value IIf statement
    By jmk909er in forum Forms
    Replies: 0
    Last Post: 10-22-2010, 07:06 PM
  2. Default value a DLookup?
    By Lockrin in forum Access
    Replies: 1
    Last Post: 07-01-2010, 08:03 PM
  3. no way to set default export to .xls ?
    By yinchiao in forum Import/Export Data
    Replies: 0
    Last Post: 04-05-2010, 12:33 PM
  4. Default Value CurrentMonth
    By Bruce in forum Forms
    Replies: 7
    Last Post: 01-27-2010, 08:39 AM
  5. Default window
    By Tareq_1993 in forum Access
    Replies: 2
    Last Post: 11-26-2009, 09:37 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