Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

faq705-5479 Not setting a default printer after use

Status
Not open for further replies.

compucornertech

Programmer
Apr 27, 2006
3
CA
Hello, first time here at the forum.

First off, I'm using MS Access 2003 on MS XP SP2.

I've got a database that uses a drop down list of the printers available so users can print to which ever printer they wish instead of just the default printer. I've used the code supplied in faq705-5479 and it works fine up to the point where it doesn't reassign the default printer after it's used.

Has anyone else used this code? or know of code that will work?

Thanks,

M
 
Maybe I'm oversimplifying but why not just use this simple code to change printer, then put it back to you original default.... (this is in Access 2002)
Code:
' Define a variable of type Printer
Dim prt As Printer
' Set it to your default printer
Set prt = Application.Printer
' Change default printer to that named here
Application.Printer = Application.Printers("\\PRINTSERVER\PRINTERNAME")
' Change default printer back to original value
Application.Printer = prt

[pc2]
 
Thanks for the tip...

I am now getting a "Invalid procedure call or argument" on this line:

Application.Printer = Application.Printers("\\WINUXBOX\HPLaser3100")


Any help would be appreciated
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top