OutputTo PDF (1 Viewer)

Gismo

Registered User.
Local time
Today, 08:27
Joined
Jun 12, 2017
Messages
1,298
Hi all,

I am exporting a PDF report utilizing the file save as module

When exporting, I get 2 files being exported but only one file saved (the required report) in the selected location and not sure where I need to make adjustments

Please could you advise

Private Sub Export_PDF_Report_Click()
On Error GoTo Export_PDF_Report_Click_Err

Dim StrFileName As String
Dim StrQryName As String
Dim StrSaveFile As String


StrFileName = strGetFileFolderName("Arms Control Report" & " - Customer -" & " " & Forms![New Entry]![CustomerNameLink], 2, "PDF")


If Len(StrFileName & "") < 1 Then
StrFileName = Application.CurrentProject.Path & "\Arms Control Report" & Format(Date, "yyyymmdd") & ".PDF"
End If


DoCmd.OutputTo acReport, ("Report - Mail"), acFormatPDF


Export_PDF_Report_Click_Exit:



Exit Sub

Export_PDF_Report_Click_Err:
MsgBox Error$
Resume Export_PDF_Report_Click_Exit
End Sub
 
Last edited:

Gismo

Registered User.
Local time
Today, 08:27
Joined
Jun 12, 2017
Messages
1,298
Ok it seems like I could have sorted that problem

Now I need the report to be saved as PDF but is not saved as all file types

Private Sub Export_PDF_Report_Click()
On Error GoTo Export_PDF_Report_Click_Err

Dim StrFileName As String
Dim StrQryName As String
Dim StrSaveFile As String


StrFileName = strGetFileFolderName("Arms Control Report" & " - Customer -" & " " & Forms![New Entry]![CustomerNameLink], 2, "PDF")



If Len(StrFileName & "") < 1 Then
StrFileName = Application.CurrentProject.Path & "\Arms Control Report" & Format(Date, "yyyymmdd") & ".PDF"
End If


DoCmd.OutputTo acReport, ("Report - Mail"), acFormatPDF, StrFileName


Export_PDF_Report_Click_Exit:

Exit Sub

Export_PDF_Report_Click_Err:
MsgBox Error$
Resume Export_PDF_Report_Click_Exit
End Sub
 

Gismo

Registered User.
Local time
Today, 08:27
Joined
Jun 12, 2017
Messages
1,298
Got it going

Thank you

Private Sub Export_PDF_Report_Click()
On Error GoTo Export_PDF_Report_Click_Err

Dim StrFileName As String
Dim StrSaveFile As String


StrFileName = strGetFileFolderName("Arms Control Report" & " - Customer -" & " " & Forms![New Entry]![CustomerNameLink], 2, "PDF")

If Len(StrFileName & "") < 1 Then
StrFileName = Application.CurrentProject.Path & "\Arms Control Report" & Format(Date, "yyyymmdd") & ".PDF"
End If

DoCmd.OutputTo acReport, ("Report - Mail"), acFormatPDF, ("Arms Control Report" & " - Customer -" & " " & Forms![New Entry]![CustomerNameLink] & ".PDF")

Export_PDF_Report_Click_Exit:

Exit Sub

Export_PDF_Report_Click_Err:
MsgBox Error$
Resume Export_PDF_Report_Click_Exit
End Sub
 

Users who are viewing this thread

Top Bottom