Link to home
Start Free TrialLog in
Avatar of pcalabria
pcalabriaFlag for United States of America

asked on

Need Help Selecting a Specific Printer in MS Access

I'm in the process of converting a MS Access 2K compiled application that was developed to run on XP so that it will also run on Win 10 computers.
Our goal is to get the application to run on both platforms so we do not have to replace all of our machines.

 (We understand the risks in using XP machines and have taken steps to mitigate them, so please help me solve this problem rather than tell me why I should not use XP).

The problem is that when XP connects to a networked printer then printer name assigned is "printername on servername": for example, "Shipping on FileServerPro".
When I generate a report in MS Acesss I have the option of selecting the default printer or a specific printer.  Each employee has a printer near his or her desk that is set up as the default printer.  Reports that need to print to the shipping print are hardcoded to print on "Shipping on FileServerPro".

Windows 10 uses a different naming convention for network printers, causing the printer name to appear simply as "Shipping" in the Printers and Faxes section.

As a result, when the MS Access code is executed in attempt to print to the shipping printer, we get an error message which essentially states that Access can not find "Shipping on FileServerPro" when run on Win 10 computers (of course this is because the Win10 computer knows the printer simply as Shipping).

I can make changes to the XP machines, or the Win10 machines, or to Access, but I need the same code to print to my networked shipping printer on both platforms.
Avatar of John Tsioumpris
John Tsioumpris
Flag of Greece image

Well you could either iterate the installed printers and do a partial match on the device name or you could refer to it by IP bypassing the naming conventions.
Avatar of pcalabria

ASKER

@john. Does Access allow me to do this?  The only way I know to select a specific printer is to open the form in design view, select page setup, then select specific printer on the middle tab, select a printer from the drop down.

The only printers that appear on the drop down are those installed for the computer.

Is there a way to do this through code?
ASKER CERTIFIED SOLUTION
Avatar of John Tsioumpris
John Tsioumpris
Flag of Greece image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
@John  This looks very promising... I'm looking into it today... The code needs to work on both XP and Win10...currently we use Access 2K to compile...If I compile with a later version of Access I'm not sure what to do to get that new code to work on the XP machines, which also have a licensed version of Access 2K installed... any thoughts would be appreciated.
More complicated than I had hoped (because access 2000 is not supported) but I'm still trying to work things out.
It seems that my problem is actually caused by a driver issue, which we are addressing in another question.  Thanks for your continued help and support.