From: cinnie on
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
--
cinnie
From: Jack Leach dymondjack at hot mail dot on
Unfortunately the Printer object was not untroduced until A2002. You will
need to do this the hard way... check http://mvps.org/access/API for
PrtDevMode code...

good luck!

--
Jack Leach
www.tristatemachine.com

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



"cinnie" wrote:

> 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
> --
> cinnie
From: cinnie on
Thanks Jack - guess it's time for me to upgrade!
--
cinnie


"Jack Leach" wrote:

> Unfortunately the Printer object was not untroduced until A2002. You will
> need to do this the hard way... check http://mvps.org/access/API for
> PrtDevMode code...
>
> good luck!
>
> --
> Jack Leach
> www.tristatemachine.com
>
> "I haven''t failed, I''ve found ten thousand ways that don''t work."
> -Thomas Edison (1847-1931)
>
>
>
> "cinnie" wrote:
>
> > 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
> > --
> > cinnie
From: Jack Leach dymondjack at hot mail dot on
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)



"cinnie" wrote:

> Thanks Jack - guess it's time for me to upgrade!
> --
> cinnie
>
>
> "Jack Leach" wrote:
>
> > Unfortunately the Printer object was not untroduced until A2002. You will
> > need to do this the hard way... check http://mvps.org/access/API for
> > PrtDevMode code...
> >
> > good luck!
> >
> > --
> > Jack Leach
> > www.tristatemachine.com
> >
> > "I haven''t failed, I''ve found ten thousand ways that don''t work."
> > -Thomas Edison (1847-1931)
> >
> >
> >
> > "cinnie" wrote:
> >
> > > 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
> > > --
> > > cinnie
From: Stefan Hoffmann on
hi Cinnie,

On 10.03.2010 17:42, cinnie wrote:
> 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 <--