A
ADB_Seeker
I've searched other posts and not found one that deals with my specific
question. All help is appreciated.
I have a subform (named: ASSIGN RESOURCE BY DWG) that contains two fields
(ORIGINATOR & REQUESTERS NAME).
When I click on my Command Button (on the form) I want it to use the
information from these two fields to get the email addresses from my
ASSIGNEES table and then create an email (with these two email addresses).
I set up a query (ASSIGNEE-QUERY) that has two fields: ASSIGNEES and EMAIL
ADDRESS. The table (named: ASSIGNEES) from which these fields come has an ID
field, which I'm not including in the query. In the Criteria under
ASSIGNEES, I put the following code:
[Forms]![ASSIGN RESOURCE BY DWG]![REQUESTERS NAME] Or [Forms]![ASSIGN
RESOURCE BY DWG]![Combo115]
Combo115 is the name of the control on the form for Originator. In the
Event Procedure for the Command Button (named COMPLETED) I have the following
code:
Private Sub sendemail_Click()
Dim strToWhom As String
Dim strMsgBody As String
strToWhom = Me![REQUESTERS NAME] & Me![ORIGINATOR]
strMsgBody = "Your ER is approved. Look in the subject line for EO
Number and associated ER Number."
DoCmd.SendObject , , , strToWhom, , , "ER REQUEST APPROVED-EO NUMBER IS:
" & Me![EO NUMBER] & " & ER NUMBER IS: " & Me![ER NUMBER], strMsgBody, True
DoCmd.Close
Exit_sendemail_Click:
Exit Sub
Err_sendemail_Click:
MsgBox Err.Description
Resume Exit_sendemail_Click
End Sub
All of this works, except the email addresses. I get the Origniator's and
Requester's names, but not email addresses.
Also, I need a semicolon & space between the two email addresses to separate
them in the email.
I am new to Access and code. Thank you in advance for your assistance!
Linda
question. All help is appreciated.
I have a subform (named: ASSIGN RESOURCE BY DWG) that contains two fields
(ORIGINATOR & REQUESTERS NAME).
When I click on my Command Button (on the form) I want it to use the
information from these two fields to get the email addresses from my
ASSIGNEES table and then create an email (with these two email addresses).
I set up a query (ASSIGNEE-QUERY) that has two fields: ASSIGNEES and EMAIL
ADDRESS. The table (named: ASSIGNEES) from which these fields come has an ID
field, which I'm not including in the query. In the Criteria under
ASSIGNEES, I put the following code:
[Forms]![ASSIGN RESOURCE BY DWG]![REQUESTERS NAME] Or [Forms]![ASSIGN
RESOURCE BY DWG]![Combo115]
Combo115 is the name of the control on the form for Originator. In the
Event Procedure for the Command Button (named COMPLETED) I have the following
code:
Private Sub sendemail_Click()
Dim strToWhom As String
Dim strMsgBody As String
strToWhom = Me![REQUESTERS NAME] & Me![ORIGINATOR]
strMsgBody = "Your ER is approved. Look in the subject line for EO
Number and associated ER Number."
DoCmd.SendObject , , , strToWhom, , , "ER REQUEST APPROVED-EO NUMBER IS:
" & Me![EO NUMBER] & " & ER NUMBER IS: " & Me![ER NUMBER], strMsgBody, True
DoCmd.Close
Exit_sendemail_Click:
Exit Sub
Err_sendemail_Click:
MsgBox Err.Description
Resume Exit_sendemail_Click
End Sub
All of this works, except the email addresses. I get the Origniator's and
Requester's names, but not email addresses.
Also, I need a semicolon & space between the two email addresses to separate
them in the email.
I am new to Access and code. Thank you in advance for your assistance!
Linda