VBA Accessing Printers Collection Freezes System
Hey All,
I'm using Access 2002 and accessing the "Printers" collection as follows. Problem is, it causes Access to freeze EVERY time. Even if I open a blank DB, go to the debug window and type " ? Printers.Count" Access hoses up.
This code works fine on other computers, and I just formatted and reinstalled XP w/ SP2 from scratch. Nothing installed other than Office XP 2002 w/ SP3, and a Printer called PDF995. Same setup as every other computer.
Any ideas?
Thanks,
Ben
Code:
Public Function SetDefaultPrinter(strPrtName As String)
Dim prnTemp As Printer
For Each prnTemp In Printers
If prnTemp.DeviceName = strPrtName Then
Set Printer = prnTemp
Exit Function
End If
Next prnTemp