Results 1 to 7 of 7
  1. #1
    TOMMY.MYERS668's Avatar
    TOMMY.MYERS668 is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Feb 2013
    Location
    West Virginia
    Posts
    77

    Output a report to pdf

    Sorry im reposting but I jacked my own thread all up.
    So far I have come up with two ways to do this. One is the outputto command wich I can make the file save to a specific folder. The problem with that is all records are put into 1 pdf and I need just the current record im looking at. The other method is using open form with a where clause that only gives me my specific record that I need and I was trying to use docmd.runcommand accmdpublish fixedformat. But doing it this way I need to be able to skip dialogue box by telling it specifically where I want it saved. I kind of need a combination of the two. Any help would be greatly appreciated.

  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,641
    You can use this technique to let the report filter itself in the OutputTo:

    Emailing a different report to each recipient
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    ketbdnetbp is offline Competent Performer
    Windows 7 32bit Access 2003
    Join Date
    Mar 2011
    Location
    Midwest
    Posts
    254
    TommyMyers668-

    See if this helps...

    http://social.msdn.microsoft.com/for...8-025ff0e0c1f3

    All the best,

    Jim

  4. #4
    TOMMY.MYERS668's Avatar
    TOMMY.MYERS668 is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Feb 2013
    Location
    West Virginia
    Posts
    77
    ok I got this one figured out also. I ended up doing it like this:

    Private Sub CREATE_PACKET_Click()
    Dim COURSEPATH As String
    Dim IDNUMBER As String
    Me.Dirty = False

    If Me![COURSE] = "92F/L/W" Then
    COURSEPATH = "92FLW"
    Else
    COURSEPATH = Me![COURSE]
    End If

    If Len(Dir(Application.CurrentProject.Path & "\" & [FIRST NAME] & " " & [LAST NAME] & " " & COURSEPATH & [SKILL LEVEL], vbDirectory)) = 0 Then
    MkDir (Application.CurrentProject.Path & "\" & [FIRST NAME] & " " & [LAST NAME] & " " & COURSEPATH & [SKILL LEVEL])
    End If
    'DoCmd.OutputTo acOutputReport, "CERTIFICATION CHECKLIST", acFormatPDF, Application.CurrentProject.Path & "\" & [FIRST NAME] & " " & [LAST NAME] & " " & COURSEPATH & [SKILL LEVEL] & "\CERTIFICATION CHECKLIST.PDF", False
    If Me.NewRecord Then
    MsgBox ("SELECT A RECORD TO PRINT")
    Else
    IDNUMBER = "[ID] = " & Me.[ID]
    DoCmd.OpenReport "CERTIFICATION CHECKLIST", acViewPreview, , IDNUMBER
    DoCmd.OutputTo acOutputReport, applicationcurrentreport, acFormatPDF, Application.CurrentProject.Path & "\" & [FIRST NAME] & " " & [LAST NAME] & " " & COURSEPATH & [SKILL LEVEL] & "\CERTIFICATION CHECKLIST.PDF", False
    DoCmd.RunCommand acCmdClose
    DoCmd.OpenReport "Request for certification memo", acViewPreview, , IDNUMBER
    DoCmd.OutputTo acOutputReport, applicationcurrentreport, acFormatPDF, Application.CurrentProject.Path & "\" & [FIRST NAME] & " " & [LAST NAME] & " " & COURSEPATH & [SKILL LEVEL] & "\CERTIFICATION MEMO.PDF", False
    DoCmd.RunCommand acCmdClose
    DoCmd.OpenReport "HEIGHT WEIGHT STATEMENT", acViewPreview, , IDNUMBER
    DoCmd.OutputTo acOutputReport, applicationcurrentreport, acFormatPDF, Application.CurrentProject.Path & "\" & [FIRST NAME] & " " & [LAST NAME] & " " & COURSEPATH & [SKILL LEVEL] & "\HEIGHT WEIGHT STATEMENT.PDF", False
    DoCmd.RunCommand acCmdClose
    If Me![7439 REQUIRED] = True Then
    DoCmd.OpenReport "MOS GT VALIDATION WITH 7439", acViewPreview, , IDNUMBER
    DoCmd.OutputTo acOutputReport, applicationcurrentreport, acFormatPDF, Application.CurrentProject.Path & "\" & [FIRST NAME] & " " & [LAST NAME] & " " & COURSEPATH & [SKILL LEVEL] & "\MOS GT VALIDATION WITH 7439.pdf", False
    DoCmd.RunCommand acCmdClose
    Else
    DoCmd.OpenReport "MOS GT VALIDATION STATEMENT", acViewPreview, , IDNUMBER
    DoCmd.OutputTo acOutputReport, applicationcurrentreport, acFormatPDF, Application.CurrentProject.Path & "\" & [FIRST NAME] & " " & [LAST NAME] & " " & COURSEPATH & [SKILL LEVEL] & "\MOS GT VALIDATION STATEMENT.pdf", False
    DoCmd.RunCommand acCmdClose
    End If
    End If

    End Sub


    this was probably not the easiest way to do this but it works like a charm.

  5. #5
    TOMMY.MYERS668's Avatar
    TOMMY.MYERS668 is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Feb 2013
    Location
    West Virginia
    Posts
    77
    it was the applicationcurrentproject.path that gave me the ideal to just make the current report in view what to output rather than the report name because i allready had code to open a report for just one record.
    Thanks for all the help!

  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,641
    Glad you got it working. I don't personally like the overhead and potential flickering from opening/closing the reports, but it will certainly work.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  7. #7
    TOMMY.MYERS668's Avatar
    TOMMY.MYERS668 is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Feb 2013
    Location
    West Virginia
    Posts
    77

    Re: Output a report to pdf

    It is very psychedelic but this one is only three memos. So its not so bad.. The db I had to put on hold for this one is 14 ... That will be a regular disco. Thanks for the help

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

Similar Threads

  1. Output Report to Excel using MACROS
    By taimysho0 in forum Programming
    Replies: 1
    Last Post: 02-22-2012, 03:49 PM
  2. Replies: 3
    Last Post: 12-19-2011, 12:46 PM
  3. .txt output from report
    By dhopper in forum Reports
    Replies: 1
    Last Post: 08-05-2011, 12:01 PM
  4. Output Report to Excel
    By BLD21 in forum Reports
    Replies: 5
    Last Post: 04-26-2011, 07:53 AM
  5. Replies: 0
    Last Post: 03-01-2010, 02:53 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