Below is the code that I have for sending an email from a
form. The part that is in bold below is for the CC portion
of the email. What is not working is the:
Me.RequestedBy.Value@nmhg.com portion.
This shows up in the email exactly as above. I want it to show as
whatever the value is in the Me.RequestedBy field with
@nmhg. If the Value in Me.RequestedBy field is Kevin
Thompson then it should show in the email as:
Kevin Thompson@nmhg.com
I am doing something wrong but cannot figure it out. Please
help!!!
form. The part that is in bold below is for the CC portion
of the email. What is not working is the:
Me.RequestedBy.Value@nmhg.com portion.
This shows up in the email exactly as above. I want it to show as
whatever the value is in the Me.RequestedBy field with
@nmhg. If the Value in Me.RequestedBy field is Kevin
Thompson then it should show in the email as:
Kevin Thompson@nmhg.com
I am doing something wrong but cannot figure it out. Please
help!!!
Code:
Sub SendMail9()
'Approved by to Finance
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
Dim clsSendObject As accSendObject
Dim strMsg As String
Dim emailsubject As String
Dim emailtext As String
Dim SL As String, DL As String
Dim toEmail As String
SL = vbNewLine
DL = SL & SL
emailsubject = "Form #" & Me.FormId.Value & "; Finance, Please Approve or Disapprove this Form."
emailtext = "Form #" & Me.FormId.Value & DL & _
"1. Please go to appropriate Form (FormPurchasedToMakeFrm) and then to the Form Number Listed above" & SL & _
"2. Complete your Checklist" & SL & _
"3. Next, Click Finance1 CheckBox in Routing above to Forward Form to BOM Analyst" & DL & _
"Thank you for your help" & DL & _
DLookup("ActualName", "ChangeFormUserNameTbl", "LoginName='" & GetCurrentUserName() & "'") & SL & _
"Engineering Manager"
toEmail = "abscombs@nmhg.com"
Set clsSendObject = New accSendObject
strMsg = String(3000, "a")
clsSendObject.SendObject , , accOutputrtf, _
toEmail, [b]DLookup("LoginName", "ChangeFormUserNameTbl", "ActualName='" & Me.EcnBomAnalystAssigned & "'") & _
"@nmhg.com; Me.RequestedBy.Value@nmhg.com"[/b], , emailsubject, emailtext, True
Set clsSendObject = Nothing
End Sub