I wrote a little VBA script to export PDF reports from MS Access 365. It works fine except for the fact that it doesn't prompt me if it's going to overwrite an existing file. I would like to get a warning before it overwrites a file and only to proceed if I click 'OK'.
Currently the line of code I'm using to output the report is:
DoCmd.OutputTo acOutputReport, stReportName, acFormatPDF, stDocName
Where (I know you all already know this but just in case):
acOutPutReport - tells Access that it's a Report-type object
stReportName - of the name of the Report object in Access
acFormatPDF - the format the report should have, in this case PDF
stDocName - the full folder path and file name of the output PDF file
I looked at the DoCmd.OutputTo method syntax but didn't see anything regarding checking for an existing file before writing the file to the folder. What do I need to modify to have Access perform this check?
Thanks!!
Thanks!!
Matt
Currently the line of code I'm using to output the report is:
DoCmd.OutputTo acOutputReport, stReportName, acFormatPDF, stDocName
Where (I know you all already know this but just in case):
acOutPutReport - tells Access that it's a Report-type object
stReportName - of the name of the Report object in Access
acFormatPDF - the format the report should have, in this case PDF
stDocName - the full folder path and file name of the output PDF file
I looked at the DoCmd.OutputTo method syntax but didn't see anything regarding checking for an existing file before writing the file to the folder. What do I need to modify to have Access perform this check?
Thanks!!
Thanks!!
Matt