Results 1 to 9 of 9
  1. #1
    Eranka is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Dec 2017
    Posts
    150

    Saving Report


    Hi

    i want to save the report to a specific folder with customer name [From textbox]. can someone please help me the code to use.

    Thanks in advance.

  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,518
    DoCmd.OutputTo, concatenating the textbox value into the file name argument.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    Eranka is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Dec 2017
    Posts
    150
    Hi

    Code:
    DoCmd.OutputTo acOutputReport, [ReportName], acFormatPDF, "E:\New folder\" & ".PDF", True
    i tried above code but its not working.

  4. #4
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,954
    You need to add a file name: "E:\New folder" & "FILENAMEHERE.PDF"

    e.g. "E:\New folder" & Me.CustomerID & ".PDF"
    or possibly "E:\New folder" & " & Me.CustomerID & " & ".PDF" ????
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  5. #5
    Eranka is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Dec 2017
    Posts
    150
    HI

    Ridders

    Code:
    DoCmd.OutputTo acOutputReport, [Reportname], acFormatPDF, "E:\New folder\" & Me.Combo21 & ".PDF", True
    tried above, but not working. any suggestion

  6. #6
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    The report name must be in quotes.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  7. #7
    Eranka is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Dec 2017
    Posts
    150
    Hi Guys

    Thank you for taking time to give me a solution.

    Code:
    DoCmd.OutputTo acOutputReport, "Report2", acFormatPDF, "E:\New folder\" & Me.Text34 & ".PDF", True
    OR

    Code:
    Dim FileName As StringDim FilePath As String
    
    
    FileName = Me.[TextboxName]
    FilePath = "Path" & FileName & ".pdf"
    DoCmd.OutputTo acOutputReport, "Report Name", acFormatPDF, FilePath
    MsgBox "Report Saved Successfully"
    Both the above code works fine to save a report in PDF format on a specific path

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

  9. #9
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,954
    Ditto.
    Eranka - did you see my solution to the 8 letter password question to also cover checking for both upper & lower case letters
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

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

Similar Threads

  1. Replies: 3
    Last Post: 04-22-2015, 04:35 AM
  2. Report changes not saving
    By khughes46 in forum Access
    Replies: 2
    Last Post: 01-30-2015, 02:35 PM
  3. Saving a report to pdf
    By tommy93 in forum Import/Export Data
    Replies: 5
    Last Post: 02-16-2013, 02:49 PM
  4. Report saving
    By krichmond0306 in forum Import/Export Data
    Replies: 1
    Last Post: 05-04-2012, 01:35 PM
  5. Print a report without saving it
    By maladoi in forum Reports
    Replies: 2
    Last Post: 08-18-2011, 12:07 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