jonnywakey
Registered User.
- Local time
- Today, 20:45
- Joined
- Feb 2, 2009
- Messages
- 33
Hi All.
I'm trying to put together a few lines of VBA code to export a report called "Rework Label Report" to a specific network location in PDF Format, I have already achieved this level of code and it works fine (code below); however each report has a unique number in the database [ID] which I would like included in the title of the PDF when exported and saved???
Any ideas / help would be much appreciated!
Code so far:-
Private Sub Command20_Click()
Dim stReport As String
Dim stSubject As String
Dim FileNamePDF As String
strSubject = "Rework Label Report" & Me!Combo3 '
strReport = "Rework Label Report"
strWhere = "[ID]=" & Me!Combo3
DoCmd.OpenReport strReport, acViewPreview, , strWhere
DoCmd.OutputTo acOutputReport, strReport, acFormatPDF, "R:\CUKDOCS\Internal Reject Database\Report PDF\Rework Label Report.pdf"
Me!Combo3 is a combobox on form which selects the number of the report to be viewed ,the user then sees a preview of their chosen report and then clicks Cmd20 to export to PDF, currently the file is named Rework Label Report when saved.
Thanks
Jonny
I'm trying to put together a few lines of VBA code to export a report called "Rework Label Report" to a specific network location in PDF Format, I have already achieved this level of code and it works fine (code below); however each report has a unique number in the database [ID] which I would like included in the title of the PDF when exported and saved???
Any ideas / help would be much appreciated!
Code so far:-
Private Sub Command20_Click()
Dim stReport As String
Dim stSubject As String
Dim FileNamePDF As String
strSubject = "Rework Label Report" & Me!Combo3 '
strReport = "Rework Label Report"
strWhere = "[ID]=" & Me!Combo3
DoCmd.OpenReport strReport, acViewPreview, , strWhere
DoCmd.OutputTo acOutputReport, strReport, acFormatPDF, "R:\CUKDOCS\Internal Reject Database\Report PDF\Rework Label Report.pdf"
Me!Combo3 is a combobox on form which selects the number of the report to be viewed ,the user then sees a preview of their chosen report and then clicks Cmd20 to export to PDF, currently the file is named Rework Label Report when saved.
Thanks
Jonny
