Link to home
Start Free TrialLog in
Avatar of patentinv
patentinv

asked on

Access 2003 the default printer become the fax,when my command button called fax is clicked?

Hi Experts,
I have a command button named fax (Access 2003), when this is clicked it will fax my report, but only if the default printer is set to fax. So I have to go into printers a and set the fax as default 1st.

Can I automate this procedure so it will always make the fax the default or is there another way to fax my report, with out having the fax be the default printer?

Thanks,
patentinv
SOLUTION
Avatar of DatabaseMX (Joe Anderson - Former Microsoft Access MVP)
DatabaseMX (Joe Anderson - Former Microsoft Access MVP)
Flag of United States of America 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
Just before your print line, use
Set Application.Printer = Application.Printers.Item(faxPrinter)
Where faxPrinter is the name of the fax printer.
 
After the print , use
Set Application.Printer = Nothing
to dset the default printer back.
Note this changes the default printer for Access only, no other apps.
Kelvin
Avatar of patentinv
patentinv

ASKER

Hi Kevinsparks,

I'm actually using a macro using the print out action, I removed the macro and placed the following code but it is not working I'm guessing there is more code to add, but I'm not the best coder that is why I was using a macro. Can you help me to get this to work?

Private Sub Command89_Click()
Set Application.Printer = Application.Printers.Item(faxPrinter)
End Sub

Thanks,
patentinv
I would check out the mvps link ... 3 methods.

mx
Hi DatabaseMX,

O.k.

Thanks,
patentinv
I just realized that kevinsparks code is fax name specific, so unless I know the fax name it will not work.
Unfortunately, this code wont work.
ASKER CERTIFIED SOLUTION
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
Thanks Experts!!

Have a happy new year!!

patentinv
I may need to keep my macro only because of my situation.

Have a happy new year!!

I appreciated your help.

Thanks
patentinv