• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 316
  • Last Modified:

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
0
patentinv
Asked:
patentinv
  • 5
  • 2
  • 2
2 Solutions
 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Commented:
This should do it for you:

http://www.mvps.org/access/reports/rpt0009.htm

mx
0
 
Kelvin SparksCommented:
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
0
 
patentinvAuthor Commented:
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
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Commented:
I would check out the mvps link ... 3 methods.

mx
0
 
patentinvAuthor Commented:
Hi DatabaseMX,

O.k.

Thanks,
patentinv
0
 
patentinvAuthor Commented:
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.
0
 
Kelvin SparksCommented:
I get around that by making a table of parameters. Just as the user selects the fax printer from the Printers, they just update the table with that printer name
Code would be somthing like
Private Sub Command89_Click()
dim faxprinter as string
faxprinter = DLookup("[ParameterValue]","Parameters","[ParamterName] = 'faxprintername'")
Set Application.Printer = Application.Printers.Item(faxPrinter)
docmd.openreport "reportname"
Set.Application.Printer = Nothing

End Sub
 
0
 
patentinvAuthor Commented:
Thanks Experts!!

Have a happy new year!!

patentinv
0
 
patentinvAuthor Commented:
I may need to keep my macro only because of my situation.

Have a happy new year!!

I appreciated your help.

Thanks
patentinv
0

Featured Post

Nothing ever in the clear!

This technical paper will help you implement VMware’s VM encryption as well as implement Veeam encryption which together will achieve the nothing ever in the clear goal. If a bad guy steals VMs, backups or traffic they get nothing.

  • 5
  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now