Re: specify printer



"samuel" <samuel@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:E960399E-2B5B-44EB-9D9E-CC3025F8356B@xxxxxxxxxxxxxxxx
I want to use the printout command to print a report to a specific printer.

The specified printer is not my default printer. How can I accomplish
this?

You don't mention what version of access your running, however there are
several ways to accomplish this goal.

One simple ways to simply open up the report in design mode and then go page
setup and then specify a particular printer and then save the report. When
you print that report it will go to that one particular printer regardless
of the default printer settings.

You can also use a coding approac.

In access 2002 and later, there is a built in printer object, and it lets
you switch the printer with ease.

You can use:

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


The above means you dont need my code.

So, to save/switch, you can use:

dim strDefaultPrinter as string

get current default printer.
strDefaultPrinter = Application.Printer.DeviceName

switch to printer of your choice:

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

do whatever.

Swtich back.

Set Application.Printer = Application.Printers(strDefaultPrinter)


--
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada
pleaseNOOSpamKallal@xxxxxxx


.



Relevant Pages

  • specify printer
    ... I want to use the printout command to print a report to a specific printer. ... The specified printer is not my default printer. ... How can I accomplish this? ...
    (microsoft.public.access.macros)
  • Re: Building An Organization Tree From Records?
    ... My objective is to accomplish both, but primarily convert my source data ... "Nikos Yannacopoulos" wrote in message ... > a tree-like report, or convert your input table to a hierarchical ...
    (microsoft.public.access.formscoding)
  • Re: Detail Height
    ... explain in detail exactly what you are trying to accomplish. ... > I have report that I use print by VB Event / on Format ... > Dim Number, Words, TheRaw As Integer ... > Number = Len'strLast data coms from VB print ...
    (microsoft.public.access.reports)
  • Re: Procedure Variable Value
    ... what I'm trying to accomplish. ... Software" called "Label Saver" (a really cool application that I have been ... PrintCount As Integer) ... >>TIME I run the report, and it gets executed only once on subsequent runs. ...
    (microsoft.public.access.reports)
  • MS Access 2003-2002 database connectivity
    ... I am new to MS Access database and want to accomplish following. ... There are multiple users who ... users will connect to 2002 and generate their report. ...
    (comp.databases.ms-access)