Report to PDF with Custom Name

murtazakhambaty

New member
Local time
Today, 20:46
Joined
Oct 4, 2014
Messages
6
Hi

I am writing the following code but its keeps on giving error. Can you please help.

Private Sub ReporttoPDF_Click()

Dim sFPath As String

sFPath = "D:\Adobe Documents\Quotation\ & Me.QuotationID & Me.QuotationYear & " --- " & Me.Company & " - " & Me.BACity"
sFPath = sFPath & Me.QuotationID & Me.QuotationYear & " ---" & Me.Company & " - " & Me.BACity & ".pdf"

DoCmd.OutputTo acOutputReport, "", acFormatPDF, sFPath, False

End Sub

I want my PDF file to save as follows:

XYZ-XYZ10000-2014 --- ABC-City.pdf
 
What is the error? Without knowing that, we will be chasing the tail here.
 
The Error is

Compile Error: Method or Data member not found
 
What version of access? pdf output isn't supported until 2007
 
Which line does it highlight? Why is there no report name specified?
 
You have an error in the first line of sFPath. I think it should be

sFPath = "D:\Adobe Documents\Quotation\ " & Me.QuotationID & Me.QuotationYear & " --- " & Me.Company & " - " & Me.BACity


HTH
 

Users who are viewing this thread

Back
Top Bottom