Sending email to Text Box

  • Thread starter Professional_in_need_of help
  • Start date
P

Professional_in_need_of help

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.
 
D

Damon Heron

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

"Professional_in_need_of help"
 
J

Joe

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"
message
news:[email protected]...
 
D

Damon Heron

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


Damon Heron said:
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

"Professional_in_need_of help"
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.
 
P

Professional_in_need_of help

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], "[email protected]", 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

Damon Heron said:
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


Damon Heron said:
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

"Professional_in_need_of help"
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.
 
D

Damon Heron

Without going thru all of it, I noticed a missing quote mark in this snippet
here (before Center):
"[email protected]", Center of Excellence", "The attached document is
highly time sensitive." _

"Professional_in_need_of help"
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], "[email protected]",
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

Damon Heron said:
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


Damon Heron said:
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

"Professional_in_need_of help"
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.
 
P

Professional_in_need_of help

Sorry just an error when retyping it. It is still giving me the error message.

Damon Heron said:
Without going thru all of it, I noticed a missing quote mark in this snippet
here (before Center):
"[email protected]", Center of Excellence", "The attached document is
highly time sensitive." _

"Professional_in_need_of help"
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], "[email protected]",
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

Damon Heron said:
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
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

"Professional_in_need_of help"
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.
 
D

Damon Heron

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
"Professional_in_need_of help"
Sorry just an error when retyping it. It is still giving me the error
message.

Damon Heron said:
Without going thru all of it, I noticed a missing quote mark in this
snippet
here (before Center):
"[email protected]", Center of Excellence", "The attached document is
highly time sensitive." _

"Professional_in_need_of help"
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], "[email protected]",
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:
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
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

"Professional_in_need_of help"
message
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.
 
Top