Solved

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

Posted on 2013-02-07
16
249 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
Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
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…
Familiarize people with the process of utilizing SQL Server functions 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 Ac…

895 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

12 Experts available now in Live!

Get 1:1 Help Now