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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to solve a menubar problem

Status
Not open for further replies.

Flippertje

Technical User
Mar 12, 2004
118
NL
I'm trying to build a menu with a button that does:

1. select a specific printer (PDFWriter)
2. print a specific report
3. set the printer back to the original printer

Is this possible? I've trying for days and can't get it to work! I've been close (i think) by trying to point the menubutton to a macro but i couldn't get a macro to these things....

Anyone??

MaNNNNNNNYYY thanks,

Flippertje!
 
In Access 2002 and above, the following VBA may get you started.
Code:
'Declare a printer variable
Dim prt As Printer
'Set it to current default printer
Set prt = Application.Printer
'Change to PDF print queue
Application.Printer = Application.Printers("PathToPDFWriterHere")
'Your code to print here
'Set default back to original printer
Application.Printer = prt

[pc2]
 
Thank you for you're help!
The code in VBA i have but the means to 'hang' this code at a button on a menubar is missing....

Can you help me here?

Tnx Flippertje !
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top