I am having problems with Microsoft Access 2010. I have a reporting module that prints reports on a printer or file. Reports can be requested by the user or automatically printed. The user requested reports run from the desktop registered by the user. Automatic printing is started by the Windows service.
We used them to print in .RTF, and they worked great. We want to change our print access report database to .PDF. This is where the fun begins. If we run the access database as a user application, the report prints fine. If we start the access database from our Windows service, we will get error 2501 "OutputTo action was canceled."
This application runs on Windows 2008 Server R2.
DoCmd.OpenReport "Summary", acViewPreview
DoCmd.OutputTo acOutputReport, "Summary", acFormatPDF, DataBasePath & "Summary.pdf"
DoCmd.Close acReport, "Summary", acSaveNo
If I changed acFormatPDF to acFormatRTF (and changed the file name to summary.rtf), that would be fine. If I run this code as a registered user, it works fine and creates a PDF file. If I changed my Windows service to "run as" the user, and not to the System account, it also works.
, ( ).
, OutputTo PDF?