GoodLife22
Registered User.
- Local time
- Today, 05:39
- Joined
- Mar 4, 2010
- Messages
- 86
I have a button that my user will click to add data from an entry form to a table, then send an email out to my clients. I am 90% done, but stuck with one problem.
This email will go to one of two people depending on the [DEPT] field. If my user selects "ACCOUNTING" then the email will go to [Email1] BUT if they add anything other than "ACCOUNTING" the email will go to [EMAIL2]
Right now no matter what I put in my drop down the new email will have [EMAIL2]
What am I doing wrong here? Thanks.
This email will go to one of two people depending on the [DEPT] field. If my user selects "ACCOUNTING" then the email will go to [Email1] BUT if they add anything other than "ACCOUNTING" the email will go to [EMAIL2]
Right now no matter what I put in my drop down the new email will have [EMAIL2]
Code:
With objOutlookMsg
.BodyFormat = olFormatHTML
If (Me![Dept]) = ACCOUNTING Then
Set objOutlookRecip = .Recipients.Add(Forms![frm_MAIN]![frm_SUBFORM_MAIN]![EMAIL1])
Else
Set objOutlookRecip = .Recipients.Add(Forms![frm_MAIN]![frm_SUBFORM_MAIN]![EMAIL2])
End If
objOutlookRecip.Type = olTo
.Subject = "We have entered the following information for your account"
What am I doing wrong here? Thanks.