I am using a VBA code in MS-Access to change the printer dynamicaly.
I have the following code:
MyPrinter = "HP Laser Jet"
APPLICATION.Printer=APPLIC
ATION.Prin
ters (MyPrinter)
But MS-Access is crashing when it gets to the second line "APPLICATION.Printer=APPLI
CATION.Pri
nters (MyPrinter)"
In the refrences I have selected:
Visual Basic for Applications
Microsoft Access 11.0 Object Library
Microsoft Forms 2.0 Object Library
Microsoft DAO 3.6 Object Library
Microsoft Windows Common Controls-2 6.0 (SP4)
Microsoft ActiveX Data Objects 2.7 Library
Microsoft Visual Basic for Applications Extensibilty 5.3
OLE Automation
The funny part is that the code works on some PCs!
No the other problem is that as soon as I type Application, it changes it to all CAPS (APPLICATION)
Any clue will be appreciated.
Start Free Trial