Davegri, that just brings up a Macro Box. Is the "Microsoft Print to PDF" supposed to be a different name?
Davegri, that just brings up a Macro Box. Is the "Microsoft Print to PDF" supposed to be a different name?
That's an example of a printer installed on my PC.Is the "Microsoft Print to PDF" supposed to be a different name?
Change it to the name of a printer installed on your PC (which may physically exist on a network in your case).
To see a list of printers installed on your PC, go to Control Panel, Devices and Printers (or in Windows 10, Settings, Devices, Printers & Scanners).
Last edited by davegri; 02-09-2018 at 10:55 AM. Reason: more
But the printer is set in the line above it, so why would you assign it twice?
I entered
Reports(stDocName).Printer = Application.Printers("\\svpprintv01\wwtrmt-1")
and it came up to the Macro Box
I assume this is bad? I don't know what a macro box is.and it came up to the Macro Box
Did you look at Devices and Printers to see if this printer is available on your PC? The name you put in must match exactly what is shown there.
This is the printer that everyone prints to. The print server's name is svpprintv01 and the printer is wwtrmt-1. It's set as default on the computers, it just doesn't take it within Access unless you go through the settings and we don't want the users doing anything but pressing the button they have always pressed. The Macro Box is the box that you actually create Macros in or search for existing ones. That's why I'm thinking it's not understanding it has to go through a print server to get to the printer in question. If it would just look at the default set on the computer, then everything would be so easy. LOL!
Did you look at Devices and Printers to see if this printer is available on your PC? The name you put in must match exactly what is shown there.
Or does it? As I noted, the printer name may be enough. That's what I saw in other examples, but I don't see where you tried that.That's why I'm thinking it's not understanding it has to go through a print server to get to the printer in question
FWIW, I thought you wanted to control and "set" the printer, not switch back and forth, so I still don't see the point in 'assigning' the default printer first - unless it ends up switching the printer for all programs. I wouldn't expect that since it appears to be set at the Application level, which should have no effect outside of Access. Maybe it ends up that way for any Access db, not just the one you made the setting in. But I said I'm no expert in this subject, so I'll leave it to others.
Ditto, Micron.
If you want to print to printer already set as default for all users then why are you bothering with code to assign default printer?
Aren't printer connections (set up in Devices and Printers) associated with Windows USERNAME? So multiple users on same computer don't necessarily have the same printer connections? Therefore, user (as known by Windows login) must be connected to printer for this code to work? Or are printer connections associated with the computer regardless of user login?
So, printer must have connection set to computer or user.
Unfortunately, I no longer have access to a LAN for testing.
By 'Macro Box', do you mean the box that pops up with a list of macros to choose (it lists all the general modules subs in my db)? I can force this box if I try to 'Run' a VBA function like a sub in the VBA editor instead of calling function.
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
Micron, I tried just putting wwtrmt-1 and it went to the Macro Box. Didn't work. I'm trying what y'all are putting on here, so if you are putting it to switch back and forth, then that's what I'm trying as code. I'm not been coding very long, so that is why I'm trying to find someone that knows about network printers. It does go through a network printer and no the users and computers are not assigned a specific printer, since we are so big. The user has to connect through devices and printers from a list of printers that are on the print servers. The printer is set as default on the computer, but Access 2016 doesn't recognize it without the user going through the page setup and they are not allowing them to do that. They want it set up the way it was in Access 2010. Unfortunately, that means coding is my understanding.
Access should print to whatever is set as the default printer in Windows without any code. I have no idea why Access 2016 would be any different.
Excel and Word have no printing issue?
However, that still does not explain why you get 'Macro Box' (BTW, you still haven't clarified what that box is).
If you are now using Access 2016, why don't you modify your profile?
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
Users don't modify anything. It's an issue with Office 365 Access 2016. It will not go off the default printer set on your computer. I've explained this in previous threads. Also, explained previously that the Macro Box that pops up is the Macro Box that you create a Macro in. With the code that was previously presented above, it goes to that. I'm assuming it's looking for a Macro for some reason. Why, can't tell ya. All I know from what I've read on the web on Access 2016, is that it doesn't act like previous versions and it doesn't take the default. You either code it or the user has to do the Page Setup within the report. We don't code in Excel and Word, so I'm just looking for Access coding help.
Third attempt to get information:
Did you look at Devices and Printers to see if this printer is available on your PC? The name you put in must match exactly what is shown there.
Also can you post a picture of the "Macro Box"?
Doesn't work with our network printer.
So it's only an issue with Office365 Access? Access will not simply print to the default network printer but Excel and Word do? Weird.
You tried: Reports(stDocName).Printer = Application.Printers("\\svpprintv01\wwtrmt-1")
stDocName is a VBA variable. Where is your code to set that variable? What is the name of the report you want to print?
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.