Deternine whether or not a printer is installed

N

Niels Jensen

I have a report than needs to be opened depending on the status of a pc's
printers. for example if the user has a printer installed then I want it to
open and automatically print the report, however if the user has no printers
installed then I want the report to open in preview mode.

My problem is that I'd like to know if theres any way of finding out if a
printer is installed or not? so something like this:

If Printers installed = true then
DoCmd.OpenReport ("Reportname")
else
DoCmd.OpenReport ("Reportname"), acviewpreview
end if
 
S

SA

Neils:

If there are no printers installed, then you can't even open the report in
preview mode, access can't format the report properly without a printer
installed.

Access will normally error with error value 2202 or 2212 if there is no
default installed so you can trap for that error.
 
Top