darkstar257
Registered User.
- Local time
- Today, 11:45
- Joined
- Jan 6, 2011
- Messages
- 77
I have a mailing list table set up which displays a list of
ID
First Name
Last Name
Email Address
I also created a form that has a drop down menu where you can select from employees by First Name. This drop down selection is then assigned to the variable ContactName.
However, can I use the email automation from Microsoft "...id=318881" to email to the Address selected based off of the First Name selected from the drop down menu?
' Create the Outlook session.
Set objOutlook = CreateObject("Outlook.Application")
' Create the e-mail message.
Set objOutlookMsg = objOutlook.CreateItem(olMailItem)
TheAddress = Forms![Complaint Form]![ContactName]
With objOutlookMsg
' Add the TO: recipients to the e-mail message.
Set objOutlookRecip = .Recipients.Add(TheAddress)
objOutlookRecip.Type = olTo
......
...
I can easily do an auto email if the ContactName is directly assigned to be an Email address, but that would cause the Complaint Form's drop down menu to display an email address instead of the person's name..which is not what i want to do.
Can I do something along the lines of:
TheAddress = Forms![Complaint Form]![SELECT EmailAddress WHERE ContactName.First Name = ContactName]
???
ID
First Name
Last Name
Email Address
I also created a form that has a drop down menu where you can select from employees by First Name. This drop down selection is then assigned to the variable ContactName.
However, can I use the email automation from Microsoft "...id=318881" to email to the Address selected based off of the First Name selected from the drop down menu?
' Create the Outlook session.
Set objOutlook = CreateObject("Outlook.Application")
' Create the e-mail message.
Set objOutlookMsg = objOutlook.CreateItem(olMailItem)
TheAddress = Forms![Complaint Form]![ContactName]
With objOutlookMsg
' Add the TO: recipients to the e-mail message.
Set objOutlookRecip = .Recipients.Add(TheAddress)
objOutlookRecip.Type = olTo
......
...
I can easily do an auto email if the ContactName is directly assigned to be an Email address, but that would cause the Complaint Form's drop down menu to display an email address instead of the person's name..which is not what i want to do.
Can I do something along the lines of:
TheAddress = Forms![Complaint Form]![SELECT EmailAddress WHERE ContactName.First Name = ContactName]
???