Solved

Is it possible to send a fax with a command button on a form?

Posted on 2013-02-07
16
250 Views
Last Modified: 2013-02-07
I have a form which has a command button.  When the button is clicked I want a report to be faxed.  Is this possible?
0
Comment
Question by:SteveL13
  • 8
  • 8
16 Comments
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 38864716
Sure, but are you saying that Emailing the report (Much Simpler) is not an option?

DoCmd.SendObject acSendReport, "YourReport", acFormatPDF, "Somebody@email.com", , , "YourSubject", "Your Message Body"
0
 

Author Comment

by:SteveL13
ID: 38864748
Actually, I need to be able to do either one.  I know its hard to believe but sometimes, in this case, faxing is the only alternative.
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 38864837
OK, I reached out to an Expert who may be able to help...
0
Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

 

Author Comment

by:SteveL13
ID: 38864890
Thank you.
0
 

Author Comment

by:SteveL13
ID: 38864976
To boag

I'm going to post a new question regarding the email choice.
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 38865028
DoCmd.SendObject acSendReport, "rptJob", acFormatPDF, "txtEmail", , , "Leigh Transport From " & [txtFromCity] & " - " & [txtToCity]",& "See attached.  Best Regards Leigh Transport"

You did not state what error you were getting, but my guess is the you don't need the quotes around: txtEmail
..and I am not sure about your concatenation
Try this:

DoCmd.SendObject acSendReport, "rptJob", acFormatPDF, txtEmail, , , "Leigh Transport From " & [txtFromCity] & " - " & [txtToCity], "See attached.  Best Regards Leigh Transport"

Or this perhaps...?:
DoCmd.SendObject acSendReport, "rptJob", acFormatPDF, txtEmail, , , "Leigh Transport From " & [txtFromCity] & " - " & [txtToCity] & ", See attached.  Best Regards Leigh Transport"
0
 

Author Comment

by:SteveL13
ID: 38865070
Sorry... I was trying to keep from asking two questions in one topic.  

Anyway,,  neither solution works.  I get an error:  "Can't find the field '|1' referred to in your expression"
0
 
LVL 74

Accepted Solution

by:
Jeffrey Coachman earned 500 total points
ID: 38865164
Check closely the names of your fields

This woks fine for me buddy:
Database88.mdb
0
 

Author Comment

by:SteveL13
ID: 38865235
You are correct... it would work for me too if I had the right field names.  But now I had to add some copy at the end of the subject line and its broken again.  Hee is what I have now...

DoCmd.SendObject acSendReport, "rptConfirmJobDetails", acFormatPDF, txtEmailAddress, , , "Leigh Transport From " & [txtFromCity] & " - " & [txtToCity] & " - Collection Details - Our Ref - " & [txtJobNo] , See attached.  Best Regards Leigh Transport"

The copy that reads "See attached... and so forth is supposed to be in the body of the email message, not on the subject line.

And one more thing...

The body should read,

Best Regards
Leigh Transport (on a new line)

Help?
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 38865307
Then I am still confused about your syntax.,...?

In any event I don't believe you can do a word wrap with just plain text in the Message body.
(Remember, SendObject was created to be a "simple, no frills" way to send an email.

You would have to go through all the trouble of creating an email in code:
http://support.microsoft.com/kb/161088
... then use .HTMLBody to display a word wrap
    YourString="Line One <br> Line Two"

(Not worth the trouble IMHO, just for a word wrap)

...Besides, what you want there is really a "Closing" statement, ...not really a "Message"
So this may be more appropriate to be set in your custom signature in Outlook

;-)

JeffCoachman
0
 

Author Comment

by:SteveL13
ID: 38865327
Ok, forget the idea about having a new line after "Best Regards".

Can you still help me with this:

DoCmd.SendObject acSendReport, "rptConfirmJobDetails", acFormatPDF, txtEmailAddress, , , "Leigh Transport From " & [txtFromCity] & " - " & [txtToCity] & " - Collection Details - Our Ref - " & [txtJobNo] , See attached.  Best Regards Leigh Transport"
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 38865434
Help you with what, specifically?
I posted a working sample...

Or better yet post a sample database and post a clear example of the *exact* output you require...


Jeff
0
 

Author Comment

by:SteveL13
ID: 38865467
I'm sorry.  Yes, you did post a working sample.  But then I had to add copy at the end of it and I broke the syntax.  

Here is what you posted which did work fine...

DoCmd.SendObject acSendReport, "rptJob", acFormatPDF, txtEmail, , , "Leigh Transport From " & [txtFromCity] & " - " & [txtToCity] & ", See attached.  Best Regards Leigh Transport"

But then I changed it to (which broke it)...

DoCmd.SendObject acSendReport, "rptJob", acFormatPDF, txtEmailAddress, , , "Leigh Transport From " & txtFromCity & " - " & txtToCity & " - Collection Details - Our Ref - " & [txtJobNo], "See attached.  Best Regards, Leigh Transport"

If I could post a sample database I would.  Again, sorry.
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 38865534
...

...you are still not telling me what is wrong...
0
 

Author Comment

by:SteveL13
ID: 38865619
I'm going to go ahead an accept your solution because I found my own mistake in a field name.

Thank you for your time.  

But I'm still going to post another question looking for help with faxing a report.
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 38865795
OK...

;-)
0

Featured Post

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Most if not all databases provide tools to filter data; even simple mail-merge programs might offer basic filtering capabilities. This is so important that, although Access has many built-in features to help the user in this task, developers often n…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question