Select a specific label printer for certain reports only? (1 Viewer)

Sebsboutique

New member
Local time
Today, 07:44
Joined
Jun 27, 2022
Messages
7
Hi all,

I have a fairly specific problem I think. I have an inventory database that allows me to issue parts out. When items are issued out it auto prints out an A4 size invoice of the transaction but also prints out a sticker to a specified label printer. The A4 sheet is printed on the Windows default printer, but the label is printed on a separate label printer.

The problem I have is that we have many staff members with different instances of these printers as we hot desk, and the label printers are dotted about the Store. When you install the original label printer its listed as "Label_Printer" for example, but you move to another desk and it will create a copy of the Printer in the Windows settings "Label_Printer(copy 1)". I assume based on model S/N's or something?

So originally I had my label reports set to print to the specific printer labelled "Label_Printer". Worked like a charm, and the labels print great. Then as we got guys up and running and they started moving to different desks we found this issue.

I was wondering if there is a way for users to select the printer from a combo box or something to stop me from having to go back into the backend every time someone moves desk within the store. :(

I still need to be able to print the A4 document from the default Windows printer, so I assume I will need to find some fancy VBA way of solving this? Any help would be a massive bonus... Honestly I cant even work out how to get the combo box to list installed printers, let alone write some code to use the combo box to select a printer to print from.

Anyone been able to solve this kind of issue before? Printing in Access is something i seem to really struggle with past the default stuff.

Many thanks in advance,
Seb
 

Gasman

Enthusiastic Amateur
Local time
Today, 07:44
Joined
Sep 21, 2011
Messages
14,299
Look at 'how to choose a printer for each report' in the similar threads at the bottom of this thread.
That should give you a start?, especially the link in post #4
 

June7

AWF VIP
Local time
Yesterday, 22:44
Joined
Mar 9, 2014
Messages
5,471
Every workstation shows a label printer named with "copy 1", not "copy 2", etc? We have Dymo label printer attached to each workstation. I see two Dymo printers listed - one has "copy 1" and seems to be only one that works. I am guessing print goes directly to label printer without routing through server, unlike jobs for the big Canon on other side of room.
 

Sebsboutique

New member
Local time
Today, 07:44
Joined
Jun 27, 2022
Messages
7
Every workstation shows a label printer named with "copy 1", not "copy 2", etc? We have Dymo label printer attached to each workstation. I see two Dymo printers listed - one has "copy 1" and seems to be only one that works. I am guessing print goes directly to label printer without routing through server, unlike jobs for the big Canon on other side of room.
HI there...

Thanks for getting back so quick... :)

Yeah it looks like windows creates a new printer per device the guys here plug into. Its not run off a server its just a usb into the machine/docking station the guys use. The problem is that the label for each printer depends on the order they have sat at desks in the store. SO original label printer is "Label Printer", then next one which could be any desk would then be "Label Printer (copy 1)" etc...

I think i need to find a solution for them to be able to select from a list of the printers that will show all the label printers they have in there system settings.

The main A4 printout send through to the selected default printer on windows over WiFi.
 

Sebsboutique

New member
Local time
Today, 07:44
Joined
Jun 27, 2022
Messages
7
Look at 'how to choose a printer for each report' in the similar threads at the bottom of this thread.
That should give you a start?, especially the link in post #4
Hi Gasman,

Thats great info, thanks. The issue is the printer name will be different on each persons machine. Need to find a way for the user to choose the label printer only... as we are printing labels like its going out of fashion, it would be a massive pain to have a dialogue pop up after each transaction?

Might be worth trying to get these printers on a network maybe? Will have to check if they support it first! lol

Thanks again :)
 

Gasman

Enthusiastic Amateur
Local time
Today, 07:44
Joined
Sep 21, 2011
Messages
14,299
Well I have not looked at that link extensively, but I *thought* that was what it would do?

From that link
You can design a report to use one of your printers by choosing Page Setup from the Page Setup ribbon (Access 2010), the Report Tools ribbon (Access 2007), or the File menu (previous versions.) But that approach is useless if others use your report: you do not know what printers they will have installed.

This utility lets the end user assign one of their printers to each report. Whenever they open the report, it is sent to that printer. The utility works with MDE files and runtime versions also.

The utility also illustrates how to manipulate the Printer object and the Printers collection introduced in Access 2002.
 

June7

AWF VIP
Local time
Yesterday, 22:44
Joined
Mar 9, 2014
Messages
5,471
We use Dymo to print address labels from the Dymo app and that print goes directly to label printer. We also print labels from a proprietary database program and that requires user selecting the destination printer. The latter changes default printer so if then want to print from Excel have to select printer and that again changes default printer. This back and forth exercise does get a bit annoying.

I have code that selects a printer and sets it as default then selects back to the original default. Complicated part in your case appears to be each workstation has a unique name for the label printer (doesn't seem to be the case in my office - I will have to check on Monday). I also have code that will list printers. So possibly loop though printers collection and when encounter name that is LIKE "Label*", grab it for setting as default then set back to original default.

Code for setting printer:
Code:
Private Sub btnPrint_Click()
'print to the color printer

Dim strDefaultPrinter As String

'load the current default printer into the variable strDefaultPrinter
strDefaultPrinter = Application.Printer.DeviceName

'switch to Konica printer for color printout
Set Application.Printer = Application.Printers("\\DotAtuPs01\DOT-PR-Atu Mat Konica 652 PCL")
'try to set printer for color - doesn't work, also tried API coding and that didn't work either
''Application.Printer.ColorMode = acPRCMColor
''Forms("ConcreteMixTools").Printer.ColorMode = acPRCMColor

Me.Detail.BackColor = vbWhite
DoCmd.PrintOut

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

End Sub
Here is looping printers:
Code:
Public Sub PrintersList()

Dim prtLoop As Printer
Dim strPrinters As String

For Each prtLoop In Application.Printers
    With prtLoop
        strPrinters = strPrinters & "Device name: " & .DeviceName & vbCr
''        strPrinters = strPrinters & "Device name: " & .DeviceName & vbCr _
            & "Driver name: " & .DriverName & vbCr _
            & "Port: " & .Port & vbCr _
            & "Duplex: " & DeviceCapabilities(.DeviceName, .Port, DC_DUPLEX, ByVal vbNullString, 0) & vbCr & vbCr
    End With
Next prtLoop

MsgBox strPrinters

End Sub
 

June7

AWF VIP
Local time
Yesterday, 22:44
Joined
Mar 9, 2014
Messages
5,471
@existenceproduc, you should start your own thread instead of hijacking existing. New thread will get more attention.

Is report set for multi-column design?
 

Users who are viewing this thread

Top Bottom