I use Access 2010 and have the Windows 7 OS. I have a form that allows the user to click on a button that will run reports. The reports will automatically run and then output to PDF files that are saved to variable assigned folder paths.
At random, I will get an error "Run time Error 2501, ouput to pdf action was cancelled". It just started occurring yesterday after I decided to rerun some reports after making changes to some of the field values in a related table. Normally, when rerunning the reports, the old PDF reports are replaced with the latest PDF reports and there are no errors.
Then, yesterday, I suddenly began getting the Run time error 2501 at random and the error stated that "the output to PDF action was cancelled. It didn't occur with every PDF report that was being replaced...only with some reports and it varied each time with regard to the reports that it would err out. It wasn't with the same reports each time I ran the process. Very strange. Once I cleared all of the old files from the folders where the reports output to, the errors would stop and everthing would run just fine.
Here is the twist... I reran all reports again this morning two times and I did not get the error one time. I never cleared out the folders and I left the previous files there to be replaced by the newly generated PDF reports. It ran just fine both times with not error 2501.
Has anyone ever had this happen? Anyone know how to fix it or prevent it from happening in the future? The file names and fie paths values are variable based within the output statement:
DoCmd.OutputTo acOutputReport, strReportName, "PDFFormat(*.pdf)", strPath + "\" + strFileName, False, "", , acExportQualityScreen
I appreciate any help. Thanks
At random, I will get an error "Run time Error 2501, ouput to pdf action was cancelled". It just started occurring yesterday after I decided to rerun some reports after making changes to some of the field values in a related table. Normally, when rerunning the reports, the old PDF reports are replaced with the latest PDF reports and there are no errors.
Then, yesterday, I suddenly began getting the Run time error 2501 at random and the error stated that "the output to PDF action was cancelled. It didn't occur with every PDF report that was being replaced...only with some reports and it varied each time with regard to the reports that it would err out. It wasn't with the same reports each time I ran the process. Very strange. Once I cleared all of the old files from the folders where the reports output to, the errors would stop and everthing would run just fine.
Here is the twist... I reran all reports again this morning two times and I did not get the error one time. I never cleared out the folders and I left the previous files there to be replaced by the newly generated PDF reports. It ran just fine both times with not error 2501.
Has anyone ever had this happen? Anyone know how to fix it or prevent it from happening in the future? The file names and fie paths values are variable based within the output statement:
DoCmd.OutputTo acOutputReport, strReportName, "PDFFormat(*.pdf)", strPath + "\" + strFileName, False, "", , acExportQualityScreen
I appreciate any help. Thanks