Code to save report in pdf to a particular folder

Ashfaque

Search Beautiful Girls from your town for night
Local time
Tomorrow, 03:52
Joined
Sep 6, 2004
Messages
897
hi,

I know how to create my report into the pdf format with below line.

DoCmd.OutputTo acOutputReport, "R_RptByRevdDate", acFormatPDF, , , , , acExportQualityPrint

But I don't know how to save in a particular folder that I created on my D:\MyFolder with its report number (that may be a record number of report) and if the same report (identify with RectNo field in it) is already saved then ask for overwrite.

Any idea?

Ashfaque
 
Try;
Code:
DoCmd.OutputTo acOutputReport, "D:\MyFolder\R_RptByRevdDate", acFormatPDF, , , , , acExportQualityPrint
 
No...

My forlder in D: drive is 'M' and when I place below;
It is opening a dialog box to save it by below name which I dont want.

D__M_R_RptByRevdDate

What I want is to save my report R_RptByRevdDate in pdf format in M folder located in D:\ drive.

Tnx
 
Further, I want it to save it directly in the folder.
 
Thanks,

I reached upto below and get success

DoCmd.OutputTo acOutputReport, "R_RptByRevdDate", acFormatPDF, _
"D:\M\R_RptByRevdDate.pdf", False

My report is being generated with date criteria (From - To) inputed in TxtFrom & TxtTo boxes on form F_ReportMaster. Now I want my report name to be as From-To date range something like 100212-120212 based on the date selected on the form F_ReportMaster.

Is it possible?

Thanks,
 
Howzit

Try something like...

Code:
Dims sFPath as string

sFPath = "D\M\R_RptByRevdDate & format(me.TxtFrom,"ddmmyy")
sFPath = sFPath & "-" & format(me.txtTo,"ddmmyy") & ".pdf"


DoCmd.OutputTo acOutputReport, "R_RptByRevdDate", acFormatPDF, _
sFPath,False
 
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:

RPL-PPH10000-2014 --- ABC-City.pdf
 

Users who are viewing this thread

Back
Top Bottom