septimus
2011-06-09 03:23:31 UTC
I have a procedure that is intended to publish an Access report as a
PDF repeatedly, each time with the recordsource data changed.
When I use the following line of code to publish the report to PDF a
single time, it works:
DoCmd.OutputTo acOutputReport, "rptIAR", acFormatPDF, strPath
Trouble is, when I run the same line of code in the middle of a loop,
I get the following error:
"Run-Time error 2501: The OutputTo action was canceled"
It doesn't appear to be a problem with the report, it works fine when
I open it under the same conditions.
I can post at least some of the code if anyone thinks it would help,
but I won't do so now because it's lengthy.
Anybody encountered this problem? Solutions?
Thanks.
PDF repeatedly, each time with the recordsource data changed.
When I use the following line of code to publish the report to PDF a
single time, it works:
DoCmd.OutputTo acOutputReport, "rptIAR", acFormatPDF, strPath
Trouble is, when I run the same line of code in the middle of a loop,
I get the following error:
"Run-Time error 2501: The OutputTo action was canceled"
It doesn't appear to be a problem with the report, it works fine when
I open it under the same conditions.
I can post at least some of the code if anyone thinks it would help,
but I won't do so now because it's lengthy.
Anybody encountered this problem? Solutions?
Thanks.