View Full Version : Printing Reports


Djblois
08-19-2010, 11:32 AM
I have an Access application that I have multiple people using. Suddenly last week the reports will not print. I have tried on multiple accounts and to different printers but it just hangs: it goes to the print dialog box and then you choose the printer and after that it says 'Printing' but it never does. Anyone have any ideas? Here is the only code that I use to print:

Private Sub cmdPrint_Click()

On Error Resume Next
DoCmd.RunCommand acCmdPrint
On Error GoTo 0

End Sub

boblarson
08-19-2010, 11:34 AM
First thing to do is to pull out that

On Error Resume Next

part because that will obscure any errors which could tell you what is happening.

Djblois
08-19-2010, 11:53 AM
I did not realize that - but I did comment it out now and I am still getting the same issue. No error code, just hangs.

boblarson
08-19-2010, 02:17 PM
See what happens if you substitute this code instead:

Private Sub cmdPrint_Click()
On Error GoTo Err_Handler

DoCmd.PrintOut
cmdPrint_Exit:
Exit Sub

Err_Handler:
MsgBox Err.Description, vbExclamation, "Error #: " & Err.Number
Resume cmdPrint_Exit
Resume
End Sub

Djblois
08-20-2010, 06:14 AM
Now I get an error and here is the error. Does anyone know what may be causing this that has never happened before? Thank everyone for helping.