User-Defined type not defined

C

cinnie

hello

I use ACCESS 2000. I'd like to run the following code borrowed from one of
the Access user sites, but compiling fails at the Dim statement.
("User-defined type not defined")

Private Sub ListAvailPrinters()
Dim prn As Printer
For Each prn In Application.Printers
Debug.Print prn.DeviceName & " on " & prn.Port
Next prn
End Sub

I suspect a Reference Library is not installed, but I'm not sure which one I
need. I currently have the following Reference Libraries:

Visual Basic For Applications
Microsoft Access 9.0 Object Library
Microsof DAO 3.6 Object Library
OLE Automation

Any suggestions?
Much thanks
 
J

Jack Leach

That may be a much easier solution! I've never used it, but from what a
gather the PrtDevMode functions are quite a pain...

--
Jack Leach
www.tristatemachine.com

"I haven''t failed, I''ve found ten thousand ways that don''t work."
-Thomas Edison (1847-1931)
 
S

Stefan Hoffmann

hi Cinnie,

I use ACCESS 2000. I'd like to run the following code borrowed from one of
the Access user sites, but compiling fails at the Dim statement.
("User-defined type not defined")

Dim prn As Printer

I suspect a Reference Library is not installed, but I'm not sure which one I
need.
No, your doomed. Oops, too theatrically.)

The Printer object was introduced to Access 2002, so it is not available
in Access 2000.

So the question is: What exactly do you like to do?



mfG
--> stefan <--
 
L

LightByrd

Stefan Hoffmann said:
hi Cinnie,


No, your doomed. Oops, too theatrically.)

The Printer object was introduced to Access 2002, so it is not available
in Access 2000.

So the question is: What exactly do you like to do?



mfG
--> stefan <--


Hello mfG
I am experiencing the same problem with a Dim statement for a new ADODB
connection
I am using Access 2002
Please see my thread called
"adding to table from drop down box"
Any thoughts?
 
C

cinnie

Hi Stefan. I'm actually not trying to do anything other than familiarize
myself with VBA. Thanks for the advice.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top