S
Stockwell43
Hello,
Here is the code I have behind my email button. So when a user is on a
record from there they click the button and the email will pull the info from
the selceted fields.
Private Sub cmdSendEmail_Click()
On Error GoTo EH
Dim SendTo As String, SendCC As String, MySubject As String, MyMessage
As String
SendTo = ""
SendCC = ""
MySubject = "Additional Information Needed"
MyMessage = vbCr & vbCr & Me.LoanNumber.Name & ": " & vbCr &
Me.LoanNumber & _
vbCr & Me.AddInfo.Name & ": " & vbCr & Me.AddInfo & _
vbCr & Me.StatusUpdate.Name & ": " & vbCr & Me.StatusUpdate
DoCmd.SendObject acSendNoObject, , , SendTo, SendCC, , MySubject,
MyMessage, True
EH:
If Err.Number = 2501 Then
MsgBox "This email message has not been sent. Message has been
cancelled."
End If
End Sub
The code works fine except the manager would like a few changes.
1. is there a way to make the Status Update field NOT appear if no comment
was made? In other words, if that field is blank on that record they don't
want the words Status Update to appear in the email.
2. How can I get this sentence:
Please provide the following on the above reference loan:
to appear in every email just above AddInfo?
Thanks!!!
Here is the code I have behind my email button. So when a user is on a
record from there they click the button and the email will pull the info from
the selceted fields.
Private Sub cmdSendEmail_Click()
On Error GoTo EH
Dim SendTo As String, SendCC As String, MySubject As String, MyMessage
As String
SendTo = ""
SendCC = ""
MySubject = "Additional Information Needed"
MyMessage = vbCr & vbCr & Me.LoanNumber.Name & ": " & vbCr &
Me.LoanNumber & _
vbCr & Me.AddInfo.Name & ": " & vbCr & Me.AddInfo & _
vbCr & Me.StatusUpdate.Name & ": " & vbCr & Me.StatusUpdate
DoCmd.SendObject acSendNoObject, , , SendTo, SendCC, , MySubject,
MyMessage, True
EH:
If Err.Number = 2501 Then
MsgBox "This email message has not been sent. Message has been
cancelled."
End If
End Sub
The code works fine except the manager would like a few changes.
1. is there a way to make the Status Update field NOT appear if no comment
was made? In other words, if that field is blank on that record they don't
want the words Status Update to appear in the email.
2. How can I get this sentence:
Please provide the following on the above reference loan:
to appear in every email just above AddInfo?
Thanks!!!