Solved

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

Posted on 2013-02-07
16
248 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
 

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
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 

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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Suggested Solutions

This article is a continuation or rather an extension from Cascading Combos (http://www.experts-exchange.com/A_5949.html) and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.

746 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now