Automated Report Printing "This document was previously formatted for printer..."
Hello,
We recently moved a database to a new server and have been experiencing this issue irregularly, seemingly more and more often:
Every morning there is an auto process kicked off and multiple reports are being printed. Usually this one report hangs up and when it tries to print it throws up that "The document was previously formatted for printer <PRINTERNAME>, but that printer isn't available. Do you want to use the default printer <DEFAULTPRINTERNAME>" dialog box.
When I come in the morning and see this I usually go to the page tab and reselect <PRINTERNAME>, then hit "OK" and it will resume the process fine.
I dont know why this one report seems to forget its printer in the morning during the auto process, but once I manually run the code it works fine. Has anyone had experience with this issue before?
I made sure to open the page setup for the report and that it is properly configured to print to <PRINTERNAME>
I also tried implementing this function to manually select <PRINTERNAME> before printing the report and unfortunately ive had no luck with it.
Any help with this is much appreciated!
Hello,
We recently moved a database to a new server and have been experiencing this issue irregularly, seemingly more and more often:
Every morning there is an auto process kicked off and multiple reports are being printed. Usually this one report hangs up and when it tries to print it throws up that "The document was previously formatted for printer <PRINTERNAME>, but that printer isn't available. Do you want to use the default printer <DEFAULTPRINTERNAME>" dialog box.
When I come in the morning and see this I usually go to the page tab and reselect <PRINTERNAME>, then hit "OK" and it will resume the process fine.
I dont know why this one report seems to forget its printer in the morning during the auto process, but once I manually run the code it works fine. Has anyone had experience with this issue before?
I made sure to open the page setup for the report and that it is properly configured to print to <PRINTERNAME>
I also tried implementing this function to manually select <PRINTERNAME> before printing the report and unfortunately ive had no luck with it.
Code:
Public Function ChoosePrinter(strPrinter As String, strReport As String)
Dim prtCurrent As Printer
Dim prtDefault As Printer
'Save current default printer
Set prtDefault = Application.Printer
'Select a specific printer as new default printer
Application.Printer = Printers(strPrinter)
'Print the report
DoCmd.OpenReport strReport
'Set printer back to former default printer
Application.Printer = prtDefault
End Function
Any help with this is much appreciated!