Results 1 to 5 of 5
  1. #1
    Pure Salt is offline Advanced Beginner
    Windows 7 32bit Access 2013
    Join Date
    Apr 2014
    Posts
    60

    Automatically save report as PDF & give a specific file name


    Hi

    I'm trying to automatically save a report with the Customer name & Quote ID as part of the file name.

    I have tried using the below as an event procedure from a button on a form.

    Private Sub Command62_Click()DoCmd.OutputTo acOutputReport, "Quotation - Save", acFormatPDF, strPathAndFile = "N:\BB Staff\Becky\Database\TEST Folder" & Customer & ".pdf", True
    End Sub

    Can anyone help please.

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,521
    vFile = "N:\BB Staff\Becky\Database\TEST Folder" & Customer & QuoteID ".pdf"
    DoCmd.OutputTo acOutputReport, "Quotation - Save", acFormatPDF, vFile, True

  3. #3
    Pure Salt is offline Advanced Beginner
    Windows 7 32bit Access 2013
    Join Date
    Apr 2014
    Posts
    60
    Thanks. Have just tried your suggestion but keep getting a syntax error.

  4. #4
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,521
    you didn't say what the error was.
    is the report name correct?
    is the filepath correct?
    does CUSTOMER value exist?
    remove the TRUE parameter. its not needed.

  5. #5
    Pure Salt is offline Advanced Beginner
    Windows 7 32bit Access 2013
    Join Date
    Apr 2014
    Posts
    60
    it says 'compile error: syntax error.
    The report name etc is all correct.

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

Similar Threads

  1. Replies: 3
    Last Post: 08-08-2015, 10:59 AM
  2. save report as pdf file
    By linoreale in forum Reports
    Replies: 5
    Last Post: 01-31-2015, 10:47 AM
  3. Replies: 4
    Last Post: 04-02-2014, 08:51 AM
  4. Save a report file without preview
    By alex__ice in forum Reports
    Replies: 2
    Last Post: 04-16-2013, 08:13 AM
  5. how to give a code for save and refresh
    By venu_resoju in forum Forms
    Replies: 7
    Last Post: 04-03-2013, 12:29 PM

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