Help with User Defined not defined

bonekrusher

Registered User.
Local time
Yesterday, 23:38
Joined
Nov 19, 2005
Messages
266
Hi Everyone,

I am trying to load all my printers into a combo box and I keep getting the error "User-Defined type not Defined". Does anyone know the Reference library for "Dim PRT as Printer"?

Code:
Private Sub Command2_Click()

Dim prt As printer

For Each prt In Application.Printers
    Me!cboPrinter.AddItem Item:=prt.DeviceName
Next prt
End Sub

Thanks!
 
Printer

I don't believe that printer objects are defined in Access.
 
You may be able to pick apart the attached printer demo i got from here to figure it out
 

Attachments

I am running the code on Access 2000. When I ran it on my work computer (access 2003) it works fine. Is this a short fall of Access 2000?

I'll take a look at the Demo you attached. Thanks
 
I ran the Demo on Access 2003 and it works fine, but I get the same error on Access 2000. Any thoughts?
 
Printer object

Pretty sure that Access 2000 and before does not support this.
One of my computers with 2003 does in fact support this as you mentioned.
 

Users who are viewing this thread

Back
Top Bottom