Results 1 to 6 of 6
  1. #1
    tommy93 is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Nov 2011
    Posts
    36

    Saving a report to pdf

    Hello,

    What i am looking for is an easier way to save my reports on a drive. At current i am using the code -
    Code:
    DoCmd.OutputTo acOutputReport, "Custinvoice", ".pdf", "C:\Users\jason\Shared\Transcon Logistics\Invoices\TL" & strFileName & " invoice.pdf", True
    This works fine. The only issue is, i want the database to save the pdf straight to the directory for the database. Thus removing the whole "C\Users|\...." so i can move the folders at will an its still work without recoding it.

    Im pretty sure there is a way to do this, however it was a while a go i did it and i cannot find a solution online.

  2. #2
    aytee111 is offline Competent At Times
    Windows 7 32bit Access 2010 32bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    The folder where your front-end database resides is:

    CurrentProject.Path

  3. #3
    tommy93 is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Nov 2011
    Posts
    36
    Quote Originally Posted by aytee111 View Post
    The folder where your front-end database resides is:

    CurrentProject.Path
    How would i put that into that code?

    I need it to go to a folder in that location. I have 3 sets of pdfs, booking confirmations, invoices and jobsheets, and need them saved in different folders as follows -

    *CurrentProject.Path*/Booking Confirmations
    *CurrentProject.Path*/Invoices
    *CurrentProject.Path*/Jobsheets

  4. #4
    aytee111 is offline Competent At Times
    Windows 7 32bit Access 2010 32bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    Dim PathName as string
    PathName=CurrentProject.Path
    DoCmd.OutputTo acOutputReport, "Custinvoice", ".pdf", PathName & "\Invoices\TL" & strFileName & " invoice.pdf", True

    etc

  5. #5
    tommy93 is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Nov 2011
    Posts
    36
    Quote Originally Posted by aytee111 View Post
    Dim PathName as string
    PathName=CurrentProject.Path
    DoCmd.OutputTo acOutputReport, "Custinvoice", ".pdf", PathName & "\Invoices\TL" & strFileName & " invoice.pdf", True

    etc
    Thankyou so much, seemed to work first time.

    Knew it'd be something simple haha.

  6. #6
    Lowell is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Mar 2012
    Location
    Manitoba, Canada
    Posts
    54
    I have been needing this info, but is this also possible in a macro?

    What do you enter for OutputTo\Output File?

    Dolittle.accdb.Path?

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

Similar Threads

  1. Saving a report to PDF format
    By Musicguy2112 in forum Reports
    Replies: 2
    Last Post: 10-28-2011, 12:06 PM
  2. saving a form
    By Ray67 in forum Forms
    Replies: 11
    Last Post: 10-23-2011, 06:45 PM
  3. Print a report without saving it
    By maladoi in forum Reports
    Replies: 2
    Last Post: 08-18-2011, 12:07 PM
  4. Saving Label on the Fly
    By frobro390 in forum Forms
    Replies: 3
    Last Post: 10-07-2010, 10:52 AM
  5. Saving data
    By mwabbe in forum Access
    Replies: 1
    Last Post: 09-09-2010, 11:18 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