Help, create a report and convert to PDF and save using a fieldname

russ1985

Registered User.
Local time
Today, 08:51
Joined
Mar 12, 2009
Messages
18
I want to be able to in a form click a button which automatically creates a report converts it to .pdf and set the PDF file name to one of the field values and saves it in a specific location (k:/statements)

E.G if field "accountno" in tblaccount is 45678 then the pdf would be called k:/statements/45678.pdf

Table Name= tblaccount

Form Name= frmaccount

Report Name= rptstatement

does anyone know the code to do this or a good forum posting to help (had a look on here and Google and could not find anything definitive)
 
This will work for Access 2007...

Code:
DoCmd.OutputTo acOutputReport, "rptstatement", "PDF Format (*.pdf)", "k:/statements/" & accountno & ".pdf", False

Earlier versions do not have the PDF output format.
 

Users who are viewing this thread

Back
Top Bottom