The point of the error routine is that if you are in it, you have triggered an error. Which means the Error object now exists in the context of the error routine. You can test "Err.Number" to see what error number has been triggered. If you get an error number for printer offline, then you can test for it in the error routine and issue an appropriate message via a message box. You can also do other things in the error routine, with the warning that an error routine should not tie up a system for a long time. You should set some program flag or use a "special" target for
Resume NoPrinter where you write code in that
_prtCmd_Click routine to hand the case for "NoPrinter" in a "normal" event context.
However, this might not be very helpful after the fact. The problem, you see, is probably outside of Access control since "Printer offline" is really a Windows driver-level error, not primarily a VBA or Access error. Therefore, the REAL way to do this is to test the printer first.
I found this link that might be helpful.
social.msdn.microsoft.com
If you can try something like this, you can test the printer status before you try to print anything with it.
Here is another thread. NOTE that the first element of the thread is reported as NOT a solution, but a couple of posts down, someone else comes up with a workable solution.
In my shutdown program -- which defrags the harddrive with Diskeeper Lite, scans for spyware with AdAware and then scans for viruses with AVG before powering down -- I want it to warn me if I left the printer on. Searching for existing threads uncovered this post, which links to this article...
www.vbforums.com