newbee Printing to different printers

rzkl

Registered User.
Local time
Today, 01:41
Joined
Nov 22, 2004
Messages
16
I have a database that I scan barcodes from pallets of product into. I have two different networked label printers on different sides of the whse. I would like to send the labels to a specific printer based on what the product that is scanned is. Is there a way that I can assign different printers to different reports?

Thanks in advance.
 
Have a look for Printer Property / Printers Property in the VBA Help files:

The following changes the default printer to the one specified in 'PrinterIndex' The Printers collection is indexed beginning with zero. If you refer to a printer by its index, the first printer is Printers(0), the second printer is Printers(1), and so on. So in your case you should be able to call this sub before printing and change the 'PrinterIndex' from 0 to 1 depending on the product before the labels print.


Sub changePrinter(PrinterIndex)

Dim prtDefault As Printer

Set Application.Printer = Application.Printers(PrinterIndex)
Set prtDefault = Application.Printer

End Sub​



Hope this helps!!
 
Last edited:
Hardcoded printer path

Is there a way to hardcode the printer path? I have an application that is going to be used by multiple users on a network but I want a certain button to always print a report for the Tool Crib guy on his printer.
 

Users who are viewing this thread

Back
Top Bottom