LJtechnical
Technical User
Hi All,
I am trying to make a report print to PDF automatically using a record no: for the file name. The following code does the job quite well, by utilising the Rename command twice.
stQuoteNum = Me![QuotationNo]
stDocName = "QuotePDFUK"
DoCmd.Rename stQuoteNum, acReport, stDocName 'Rename with record number
DoCmd.OpenReport stQuoteNum, acNormal
DoCmd.Rename stDocName, acReport, stQuoteNum 'Revert back to original filename
The only problem here is that to do this you have sole use of the Database to carry out this task. Also I'm not convinced this is the safest way of achieving what I want as if the process gets interrupted it is possible to lose the original filename.
Any suggestions gratefully received.
I am trying to make a report print to PDF automatically using a record no: for the file name. The following code does the job quite well, by utilising the Rename command twice.
stQuoteNum = Me![QuotationNo]
stDocName = "QuotePDFUK"
DoCmd.Rename stQuoteNum, acReport, stDocName 'Rename with record number
DoCmd.OpenReport stQuoteNum, acNormal
DoCmd.Rename stDocName, acReport, stQuoteNum 'Revert back to original filename
The only problem here is that to do this you have sole use of the Database to carry out this task. Also I'm not convinced this is the safest way of achieving what I want as if the process gets interrupted it is possible to lose the original filename.
Any suggestions gratefully received.