Advertisement

07.23.2008 at 10:46AM PDT, ID: 23589463
[x]
Attachment Details

I am using Application.Printers(MyPrinterName), but when it gets to that line, MS-Access is crashing!

Asked by rezasaha in Access Coding/Macros, Access Architecture/Design, Access Reports

Tags: Microsoft, MS-Access, 2003, SP 2

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=APPLICATION.Printers (MyPrinter)

But MS-Access is crashing when it gets to the second line  "APPLICATION.Printer=APPLICATION.Printers (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
 
 
[+][-]07.23.2008 at 11:00AM PDT, ID: 22072004

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.23.2008 at 11:08AM PDT, ID: 22072097

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.24.2008 at 05:53PM PDT, ID: 22085118

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Access Coding/Macros, Access Architecture/Design, Access Reports
Tags: Microsoft, MS-Access, 2003, SP 2
Sign Up Now!
Solution Provided By: LSMConsulting
Participating Experts: 1
Solution Grade: B
 
 
[+][-]08.06.2008 at 06:07PM PDT, ID: 22176684

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628