The second piece of code below is what I currently have that picks up names
from TextBoxes and adds them to an email. I have found out that I also have
another field I need to pick up for this email. It is called Materials Distribution.
It is a ComboBox that only has one name in it. The name is Kim Dees. Her
email address is abkdees@nmhg.com. How can I get this added to the Email?
I tried this:
But I do not know how to make it a part of the code below?
from TextBoxes and adds them to an email. I have found out that I also have
another field I need to pick up for this email. It is called Materials Distribution.
It is a ComboBox that only has one name in it. The name is Kim Dees. Her
email address is abkdees@nmhg.com. How can I get this added to the Email?
I tried this:
Code:
If Forms!ECNBCNVIPfrm!ECNDetailfrm![Materials Distribution] = "Kim Dees" Then
toEmail1 = "abkdees@nmhg.com"
End If
Code:
Dim x
Dim y
toEmail1 = ""
For Each x In Split(Forms!ECNBCNVIPfrm!ECNDetailfrm![Engineering Distribution] & "", vbCrLf)
If Trim(x & "") > "" Then
y = DLookup("LoginName", "FormEngMETbl", "EngME='" & x & "'")
If Trim(y & "") > "" Then
toEmail1 = toEmail1 & y & "@nmhg.com;"
End If
End If
Next
For Each x In Split(Forms!ECNBCNVIPfrm!ECNDetailfrm![Quality Distribution] & "", vbCrLf)
If Trim(x & "") > "" Then
y = DLookup("LoginName", "FormQAEngTbl", "QAEng='" & x & "'")
If Trim(y & "") > "" Then
toEmail1 = toEmail1 & y & "@nmhg.com;"
End If
End If
Next
For Each x In Split(Forms!ECNBCNVIPfrm!ECNDetailfrm![MasterSchedulerDistribution] & "", vbCrLf)
If Trim(x & "") > "" Then
y = DLookup("LoginName", "FormMasterSchedulerTbl", "MasterSchedulers='" & x & "'")
If Trim(y & "") > "" Then
toEmail1 = toEmail1 & y & "@nmhg.com;"
End If
End If
Next