>I need the user to be able to select the printer for 2 different reports.
>I
[quoted text clipped - 16 lines]
>
> What should I do?
Thank you for your help Ken. So I can make a form that has all of the
printers in a drop-down box. Then I store that in a global string variable
(called SlipPrinter). Then on the form that prints the slip I would type:
Application.Printers (SlipPrinter)
DoCmd.OpenReport "Report Name", acViewNormal
Application.Printers = nothing
Is that correct? I think I am missing something!
> Are you using ACCESS 2002 or 2003? If yes, check out the Application.Printer
> object in Help. It will let you change the printer for a specific report
[quoted text clipped - 22 lines]
> >
> > What should I do?
Ken Snell [MVP] - 28 Feb 2005 15:40 GMT
Close.
Set Application.Printer = Application.Printers (SlipPrinter)
DoCmd.OpenReport "Report Name", acViewNormal
Set Application.Printer = Nothing
Also, be sure that SlipPrinter contains the DeviceName string from the
desired printer.

Signature
Ken Snell
<MS ACCESS MVP>
> Thank you for your help Ken. So I can make a form that has all of the
> printers in a drop-down box. Then I store that in a global string
[quoted text clipped - 38 lines]
>> >
>> > What should I do?
James - 28 Feb 2005 23:13 GMT
Ken, thank you for your help again! This is what I have but in the immidiate
window I type debug.print SlipPrinter it gives me a blank line. If I replace
it with DLookup... it shows the correct printer. Also when I run the code I
get this error:
Runtime error 438 Object doesn't support this property or method.
And ideas?
-----------Start of code-------------
Private Sub Preview_Click()
Dim SlipPrinter As String
SlipPrinter = DLookup("[Printer]", "DefaultLabelPrinter", "[ID] = 1")
Set Application.Printer = Application.Printer(SlipPrinter)
If Me.blnMailbox = True Then
DoCmd.OpenReport "MailboxSlip", acViewNormal
End If
If Me.blnPackage = True Then
DoCmd.OpenReport "PackageSlip", acViewNormal
End If
DoCmd.Close acForm, "Reprint Slip Options"
Application.Printer = Nothing
End Sub
-------------end of code-----------------------
> Close.
>
[quoted text clipped - 46 lines]
> >> >
> >> > What should I do?
Ken Snell [MVP] - 28 Feb 2005 23:40 GMT
In my original reply, I noted that you must be using ACCESS 2002 or 2003 for
this approach to work. Are you using an earlier version of ACCESS?

Signature
Ken Snell
<MS ACCESS MVP>
> Ken, thank you for your help again! This is what I have but in the
> immidiate
[quoted text clipped - 83 lines]
>> >> >
>> >> > What should I do?
James - 01 Mar 2005 02:29 GMT
I am using 2003. I did have the mdb file saved as 2000 format, but converted
it to 2002-2003 format but still same error.
> In my original reply, I noted that you must be using ACCESS 2002 or 2003 for
> this approach to work. Are you using an earlier version of ACCESS?
[quoted text clipped - 86 lines]
> >> >> >
> >> >> > What should I do?
Ken Snell [MVP] - 01 Mar 2005 02:36 GMT
I see a typo:
Change this line:
Set Application.Printer = Application.Printer(SlipPrinter)
to this:
Set Application.Printer = Application.Printers(SlipPrinter)
Not sure why SlipPrinter is showing as a blank value, when the DLookup value
is working. What value do you get from the DLookup call?

Signature
Ken Snell
<MS ACCESS MVP>
>I am using 2003. I did have the mdb file saved as 2000 format, but
>converted
[quoted text clipped - 99 lines]
>> >> >> >
>> >> >> > What should I do?
James - 01 Mar 2005 02:51 GMT
The DLookup shows the value of the printer that was saved. I think it works
now, but my file seems to be corrupt, so I will try it again with a backup.
> I see a typo:
>
[quoted text clipped - 110 lines]
> >> >> >> >
> >> >> >> > What should I do?
Sondra - 28 Apr 2005 21:46 GMT
James:
Can you help me with the form you created for the printers? I would love to
know how you did the whole process of getting the form to actually choose the
correct printer.
> Thank you for your help Ken. So I can make a form that has all of the
> printers in a drop-down box. Then I store that in a global string variable
[quoted text clipped - 32 lines]
> > >
> > > What should I do?
James - 30 Apr 2005 16:34 GMT
Sondra,
The code from the previous post is what I used. However, on some systems
the computer locks up when it tries to print. I changed it so that the user
can go into the form and change manually the specific printer.
> James:
>
[quoted text clipped - 38 lines]
> > > >
> > > > What should I do?