Hello all,
I have a small application in MS Access 2000 that I want to move to MS Access 2007.
The application is running fine in 2000 but when I run it in 2007 I get the following error:
"The openreport action was cancelled. Error: 2501"
I can see that the print job gets to the print queue gets processed and disappears, but nothing comes out of the printer. I tried different printers with different drivers but no luck.
Any help would be greatly appreciated,
Thanks in advance,
Here's the code:
I have a small application in MS Access 2000 that I want to move to MS Access 2007.
The application is running fine in 2000 but when I run it in 2007 I get the following error:
"The openreport action was cancelled. Error: 2501"
I can see that the print job gets to the print queue gets processed and disappears, but nothing comes out of the printer. I tried different printers with different drivers but no luck.
Any help would be greatly appreciated,
Thanks in advance,
Here's the code:
Code:
Public Function PrintWorkOrder()
On Error GoTo Err_PrintWorkOrder
Dim stDocName As String
stDocName = "rptWOPlant"
DoCmd.OpenReport stDocName, acViewNormal
stDocName = "rptWOPacking"
DoCmd.OpenReport stDocName, acViewNormal
stDocName = "rptWOOffice"
DoCmd.OpenReport stDocName, acViewNormal
Exit_PrintWorkOrder:
Exit Function
Err_PrintWorkOrder:
MsgBox Err.Description, vbOKOnly, "Error: " & Err.NUMBER
Resume Exit_PrintWorkOrder
End Function