Selecting Printers for reports (A97) (1 Viewer)

homer2002

Registered User.
Local time
Today, 00:53
Joined
Aug 27, 2002
Messages
152
Hi

i've searched for a simple solution for this andI apologise if this has already been coverered... but


I found this little snippet of code to change the default printer, print a report and then change back the default printer..

It looked somthing like this
__________________________________________________________

Dim devs As Devices
Dim dev As Device


Sub ChangeDefaultPrinterAndPrint(ByVal PrinterToPrintTo As String)
Set devs = New Devices
Set dev = devs.CurrentDevice
Set devs.CurrentDevice = devs(PrinterToPrintTo)
DoCmd.OpenReport "YourReport"
Set devs.CurrentDevice = dev
Set devs = Nothing
Set dev = Nothing
End Sub

_________________________________________________________________

i've tried this and get the Error message ... "User Defined Type Not Allowed"

Can someone tell me if i'm missing a reference for this or does it not work for Access 97?


thanks in advance

Homer
 

Users who are viewing this thread

Top Bottom