It's not very clean, but it works...
Install PDFCreator and modify the PDFCreator.ini as follows:
AutosaveDirectory -> <PDF_Path>
useautosave -> "1"
AutosaveFormat -> "0"
AutosaveFilename -> "<Title>"
Make sure that the Caption property of the report is void (found in the Property window, Format tab, first field from the top)
DoCmd.CopyObject , sPDFName, acReport, sRptName
Print the newly created report with
DoCmd.OpenReport sPDFName, acViewNormal, , , acHidden
Delete the report to free resources
DoCmd.DeleteObject acReport, sPDFName
The <Title> variable, used by PDFCreator, usually takes the value of the report's Caption property. If Caption is void, the name of the report is used.
You cannot rename the report because the Name property is readonly.
Hope it will help
Install PDFCreator and modify the PDFCreator.ini as follows:
AutosaveDirectory -> <PDF_Path>
useautosave -> "1"
AutosaveFormat -> "0"
AutosaveFilename -> "<Title>"
Make sure that the Caption property of the report is void (found in the Property window, Format tab, first field from the top)
DoCmd.CopyObject , sPDFName, acReport, sRptName
Print the newly created report with
DoCmd.OpenReport sPDFName, acViewNormal, , , acHidden
Delete the report to free resources
DoCmd.DeleteObject acReport, sPDFName
The <Title> variable, used by PDFCreator, usually takes the value of the report's Caption property. If Caption is void, the name of the report is used.
You cannot rename the report because the Name property is readonly.
Hope it will help
Last edited: