Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Use Code to specify report's Printer

Status
Not open for further replies.

tyrdrannoy

Programmer
Joined
May 17, 2005
Messages
3
Location
US
is there a way to use vba code to specify a report's printer before sending it to print? we don't want to save the report with "use specific printer" because we have many users that just hit the "print" button and we want that to go to their default printer.

--thanks in advance
 
Public Function setprinters()

Dim prt As Printer

' Get the Printer object for the selected printer.
Set prt = Application.Printers("\\COMPUTERNAME\PRINTERNAME")

' Set the selected printer as the default printer for this session.
Set Application.Printer = prt

End Function

In the ON OPEN event of the report call this function.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top