Solved

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

Posted on 2013-02-07
16
252 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
Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

 

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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
Familiarize people with the process of utilizing SQL Server stored procedures 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 Micr…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

749 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