Setting a Default Printer inside Access form

H

Hansford cornett

I have a login form/table that detects who the user is that is logged into
one of my projects. I have added variables [PrjADefaultPrinter] and
[NormalPrinter] to my table with the PrjADefaultPrinter = A_IPADDRESS and
NormalPrinter = B_IPADDRESS.

My goal is to set the default printer upon logging in to A_IPADDRESS and to
B_IPADDRESS when the user clicks the exit button to leave the application.

Any help you can offer would be greatly appreciate.

Dwight
 
A

Allen Browne

What version of Access is this?

If 2002 or later, you can set the printer like this:
Set Application.Printer = Application.Printers(0)
or if you prefer:
Set Application.Printer = Application.Printers("Microsoft Office
Document Image Writer")

Then to reset it to the default Windows printer again:
Set Application.Printer = Nothing

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

message
news:[email protected]...
 
H

Hansford cornett

Thanks thanks and thanks will give that a shot after I eat lunch....

HAVE A GREAT DAY and THANKS AGAIN!
--
Hansford D. Cornett


Allen Browne said:
What version of Access is this?

If 2002 or later, you can set the printer like this:
Set Application.Printer = Application.Printers(0)
or if you prefer:
Set Application.Printer = Application.Printers("Microsoft Office
Document Image Writer")

Then to reset it to the default Windows printer again:
Set Application.Printer = Nothing

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

message
I have a login form/table that detects who the user is that is logged into
one of my projects. I have added variables [PrjADefaultPrinter] and
[NormalPrinter] to my table with the PrjADefaultPrinter = A_IPADDRESS and
NormalPrinter = B_IPADDRESS.

My goal is to set the default printer upon logging in to A_IPADDRESS and
to
B_IPADDRESS when the user clicks the exit button to leave the application.

Any help you can offer would be greatly appreciate.

Dwight
 
T

TonyT

And if you are still using 2000?



Allen Browne said:
What version of Access is this?

If 2002 or later, you can set the printer like this:
Set Application.Printer = Application.Printers(0)
or if you prefer:
Set Application.Printer = Application.Printers("Microsoft Office
Document Image Writer")

Then to reset it to the default Windows printer again:
Set Application.Printer = Nothing

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

message
I have a login form/table that detects who the user is that is logged into
one of my projects. I have added variables [PrjADefaultPrinter] and
[NormalPrinter] to my table with the PrjADefaultPrinter = A_IPADDRESS and
NormalPrinter = B_IPADDRESS.

My goal is to set the default printer upon logging in to A_IPADDRESS and
to
B_IPADDRESS when the user clicks the exit button to leave the application.

Any help you can offer would be greatly appreciate.

Dwight
 
A

Allen Browne

Albert Kallal has a downloadable example for switching printers with earlier
versions. For Access 2000:
http://www.members.shaw.ca/AlbertKallal/msaccess/printch2k.zip
of for Access 97:
http://www.members.shaw.ca/AlbertKallal/msaccess/printch97.zip

It was also possible (though messy) to use PrtMip. Details:
http://msdn.microsoft.com/archive/d...umControllingYourPrinterinMicrosoftAccess.asp

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

TonyT said:
And if you are still using 2000?

Allen Browne said:
What version of Access is this?

If 2002 or later, you can set the printer like this:
Set Application.Printer = Application.Printers(0)
or if you prefer:
Set Application.Printer = Application.Printers("Microsoft Office
Document Image Writer")

Then to reset it to the default Windows printer again:
Set Application.Printer = Nothing

message
I have a login form/table that detects who the user is that is logged
into
one of my projects. I have added variables [PrjADefaultPrinter] and
[NormalPrinter] to my table with the PrjADefaultPrinter = A_IPADDRESS
and
NormalPrinter = B_IPADDRESS.

My goal is to set the default printer upon logging in to A_IPADDRESS
and
to
B_IPADDRESS when the user clicks the exit button to leave the
application.

Any help you can offer would be greatly appreciate.

Dwight
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top