PDF Report Naming

Johnsonsimon

Registered User.
Local time
Today, 15:13
Joined
May 5, 2012
Messages
45
Hello all,

I have some code (which I will post below), that outputs one of my reports to a specific location as a PDF and also names the file based on 2 fields within the current form... [Job Number] and [Client Name].

My issue is that when the Client name has a SPACE in it, the PDF is saved with %20 in the name. i.e. if the client is called Mr Smith the PDF will save as '00001-Mr%20Smith.pdf'

Can anyone assist with this as I need to to just put a normal space in and not the %20.


Any help will be appreciated

Si
Code:
DoCmd.RunCommand acCmdSaveRecord
DoCmd.OpenReport "rpt_Job", acViewReport, "", "[Job Number]=[Forms]![frm_Job]![Job Number]", acHidden
DoCmd.OutputTo acOutputReport, "rpt_Job", "PDFFormat(*.pdf)", "n:/" & [Job Number] & "-" & [Client Name] & ".pdf", True, "", , acExportQualityScreen
DoCmd.Close acReport, "rpt_Job"
 
"n:/" & [Job Number] & "-" & [Client Name] & ".pdf"

->

"n:\" & [Job Number] & "-" & [Client Name] & ".pdf"
 
Thank you so much, that works an absolute treat.

Much appreciated.
Cheers

Si
 

Users who are viewing this thread

Back
Top Bottom