Send Report to a specific printer, without prompting

  • Thread starter FlBrent via AccessMonster.com
  • Start date
F

FlBrent via AccessMonster.com

Hi,
I purchased ACGSoft software to help us allow our application users to
choose a network printer, via the printer window, to print their reports,
which works great. However, we have an automated report scheduler, that runs
reports at specifc times, without user input, that I want to be able to send
the report to a network printer, just using a printer name or path that we
pull in from our report schedule table. Can this be done with 'On the fly
printing' software from ACGSoft or is there another way to do this? Thanks,
in advance.
 
I

Ivan Grozney

Well, I don't know via ACGSoft but what I do is something like this.

Dim stDocName As String
Dim strDefaultPrinter As String
Dim strUsePrinter As String

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

' Read the Printer Name you want to use
strUsePrinter = DLookup("[DPrint]", "qry_WhoPrint", "[WhoID] =" &
"(Forms![Print]!WhoID)")

' Set the printer to what the user requested
Set Application.Printer = Application.Printers(strUsePrinter)

stDocName = "rptPrintTest"
DoCmd.OpenReport stDocName, acNormal

' Set printer back to default printer
Set Application.Printer = Application.Printers(strDefaultPrinter)


HTH

Vanya
 
Top