Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms / March 2007

Tip: Looking for answers? Try searching our database.

Sending email to Text Box

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Professional_in_need_of help - 08 Mar 2007 14:27 GMT
I have a form and a report.  I want to send the report to a person name that
I have on the form. How can I get the database to use that name in the text
box to send the report for that certain record.
Damon Heron - 08 Mar 2007 17:45 GMT
Here is one way.  It relies on a combobox with the email addresses listed
and a command button. Look up SendObject in help.  There are a number of
different formats, the best of which is snapshot because it doesn't alter
your report's appearance.

Private Sub cmdSend_Click()
Me.cboEmail.SetFocus
DoCmd.SendObject acSendReport, "My Report", acFormatRTF, [cboEmail].Text, ,
, "Weekly Report", "Here is the report you asked for", 0
End Sub

>I have a form and a report.  I want to send the report to a person name
>that
> I have on the form. How can I get the database to use that name in the
> text
> box to send the report for that certain record.
Damon Heron - 08 Mar 2007 18:02 GMT
Ooops.
don't need the setfocus if you eliminate the ".Text" in the command. So:
DoCmd.SendObject acSendReport, "My Report", acFormatRTF, [cboEmail], , ,
"Weekly Report", "Here is the report you asked for", 0

Damon

> Here is one way.  It relies on a combobox with the email addresses listed
> and a command button. Look up SendObject in help.  There are a number of
[quoted text clipped - 12 lines]
>> text
>> box to send the report for that certain record.
Professional_in_need_of help - 08 Mar 2007 19:15 GMT
Here is the code that I have entered and I keep getting an error message.  
Please help

Private Sub Command37_Click()
DoCmd.SendObject acSendReport, "NOTICE OF STANDBY LC AUTORENEWAL (13 month
renewals)", acFormatSNP, [RM Name], [PM Name], "LC.Autoren@funb.com", Center
of Excellence", "The attached document is highly time sensitive." _
              & vbNewLine _
              & "" _
              & vbNewLine _
              & "If you experience issues with opening the attached email
please download Microsoft Snapshot Viewer." _
              & vbNewLine _
              & "Link:
http://support.microsoft.com/default.aspx?scid=kb;en-us;175274" _
              & vbNewLine _
              & "" _
              & vbNewLine _
              & "Please Print and Fax Completed Copy to (###) ###-####  
Attn:  Group" _
              & vbNewLine _
              & "" _
              & vbNewLine _
              & "Thank you."
End Sub

> Ooops.
> don't need the setfocus if you eliminate the ".Text" in the command. So:
[quoted text clipped - 19 lines]
> >> text
> >> box to send the report for that certain record.
Damon Heron - 08 Mar 2007 19:26 GMT
Without going thru all of it, I noticed a missing quote mark in this snippet
here (before Center):
"LC.Autoren@funb.com", Center of Excellence", "The attached document is
highly time sensitive." _

> Here is the code that I have entered and I keep getting an error message.
> Please help
[quoted text clipped - 50 lines]
>> >> text
>> >> box to send the report for that certain record.
Professional_in_need_of help - 08 Mar 2007 20:00 GMT
Sorry just an error when retyping it.  It is still giving me the error message.

> Without going thru all of it, I noticed a missing quote mark in this snippet
> here (before Center):
[quoted text clipped - 55 lines]
> >> >> text
> >> >> box to send the report for that certain record.
Damon Heron - 08 Mar 2007 20:28 GMT
What is the error msg? are you putting a breakpoint in your code?  are you
using Outlook?  I would begin by reducing the sendobject command to its bare
essentials, if it works then begin to add some of your other code, one step
at a time, until it crashes with the error msg.
Let me know what you find.

Damon
> Sorry just an error when retyping it.  It is still giving me the error
> message.
[quoted text clipped - 71 lines]
>> >> >> text
>> >> >> box to send the report for that certain record.
Joe - 08 Mar 2007 17:46 GMT
You can use "DoCmd.SendObject" without quotes.

You will also have to pull the e-mail address from the database
as the e-mail client can only send to an e-mail address not a
name.

If the e-mail address is on the form you can put that into a
variable to send it to that address.  Otherwise you will have to
use the "DLookup" domain aggregate function.

HTH,

Joe

"Professional_in_need_of help"
<Professionalinneedofhelp@discussions.microsoft.com> wrote in
message
news:CD7A9BEF-AD72-426B-9498-4931F1CE95D3@microsoft.com...
>I have a form and a report.  I want to send the report to a
>person name that
> I have on the form. How can I get the database to use that name
> in the text
> box to send the report for that certain record.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.