OnError

D

DS

this line gives me an error when the printer is not connected
Set Application.Printer = Application.Printers(Me.TxtName.Value)
So I want to do an OnError
How would I do this....

Set Application.Printer = Application.Printers(Me.TxtName.Value)
If OnError Then
DoCmd.OpenForm "frmMistake"
Else:
End If

Any help appreciated,
Thanks
DS
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Printing a Report on a command button 1
Access change My Default Printer for All the Reports 4
Code Is Slow 3
Code Is Slow 6
Loop Problem 5
RECORDSET 2
Is This Good? 13
PDF Toolbar Button 4

Top