PC Review


Reply
Thread Tools Rate Thread

Check for installed printer???

 
 
Brian
Guest
Posts: n/a
 
      27th Apr 2010
I have a report in my Access database that must be printed to a specific
printer. Is there a simple Boolean function that I can pass the printer name
to so I can verify whether it has been installed on the computer?
 
Reply With Quote
 
 
 
 
Daniel Pineault
Guest
Posts: n/a
 
      27th Apr 2010
I just put the following together, it should do the trick

Function Check4Printer(sPrinterName As String) As Boolean
On Error GoTo Error_Handler
Dim prtAvailPrinters As Printer

Check4Printer = False
For Each prtAvailPrinters In Application.Printers
With prtAvailPrinters
If sPrinterName = .DeviceName Then Check4Printer = True
End With
Next prtAvailPrinters

Error_Handler_Exit:
On Error Resume Next
Exit Function

Error_Handler:
MsgBox "MS Access has generated the following error" & vbCrLf & vbCrLf &
"Error Number: " & _
Err.Number & vbCrLf & "Error Source: Check4Printer" & vbCrLf & "Error
Description: " & _
Err.Description, vbCritical, "An Error has Occured!"
Resume Error_Handler_Exit
End Function
--
Hope this helps,

Daniel Pineault
http://www.cardaconsultants.com/
For Access Tips and Examples: http://www.devhut.net
Please rate this post using the vote buttons if it was helpful.



"Brian" wrote:

> I have a report in my Access database that must be printed to a specific
> printer. Is there a simple Boolean function that I can pass the printer name
> to so I can verify whether it has been installed on the computer?

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
check for installed printer Keith G Hicks Windows XP General 22 14th Mar 2010 04:34 AM
XP embeded has no installed printer drivers. Need XP printer drive AMD Windows XP Print / Fax 1 22nd May 2008 06:36 PM
Printer Driver will not stay installed - asks to install immediately after installing when clicking on printer properties. bcclegalemail@gmail.com Windows XP Print / Fax 15 2nd Apr 2007 11:13 PM
Ho do I create a program that can get recognized as a printer driver and installed with the add printer commandes. Bob Microsoft VB .NET 3 3rd May 2006 08:43 PM
Error message: The server for the "fill in printer model here" printer does not have the correct printer driver installed. -- Read on... - errorP.JPG (0/1) Tom Barnett Microsoft Windows 2000 Printing 0 14th Oct 2003 08:23 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:34 AM.