Selecting the Printer for a Report in a .mde file

  • Thread starter Thread starter Marco
  • Start date Start date
M

Marco

Is there any way to automate the process of selecting a
specific printer for a report in a .mde file, (no in
a .mdb).

Thanks
 
You don't mention what version of ms-access.

Prior to a2002, you had to use some code. (I have some sample code that will
do this for you).

Note that access XP does have built in the ability to switch printers. So,
while my code *should* work, you do NOT need it in a2002.

You can use:

Set Application.Printer = Application.Printers("HP LaserJet Series II")


The above means you don't need my code.

So, to save/switch, you can use:

dim strDefaultPrinter as string

' get current defualt printer.
strDefaultPrinter = Application.Printer.DeviceName

' swtich to printer of your choice:

Set Application.Printer = Application.Printers("HP LaserJet Series II")

do whatever.

Swtich back.

Set Application.Printer = Application.Printers(strDefaultPrinter)

If you want some code for prior to a2002, grab my example that works with
mde files at:

http://www.attcanada.net/~kallal.msn/msaccess/msaccess.html
 
Back
Top