Hi, I created a form where by scanning a barcode, a specific label from a report is automatically printed. By opening the database I also created a form where the user has to choose which mobile scanner/printer they are using. Depending on the selection, I would like the report to print on the correct mobile printer. All printers have been installed on the Print Server. Is there a way to specify in vba the specific printer and paper size to use on the report before printing out ?
Adam Schwanz
@Reply 2 years ago
Application.Printer is what you should look into, something like this
Dim myPrinter As String
myPrinter = "CaseSensitivePrinterName"
Set Application.Printer = Application.Printers(myPrinter)
Alternatively you can look into code to change the default printer to print with and change it back with code after it's printed.
Or you can look into using something like ShellExecute to print something to a specific printer.
Adam Schwanz
@Reply 2 years ago
Missed the part you said based on user, you would also want to use ENVIRON to get the current windows user
Sorry, only students may add comments.
Click here for more
information on how you can set up an account.
If you are a Visitor, go ahead and post your reply as a
new comment, and we'll move it here for you
once it's approved. Be sure to use the same name and email address.
This thread is now CLOSED. If you wish to comment, start a NEW discussion in
Visitor Forum.