S
Stephanie
Hi. I originally was using field EmailName. Now, I'd like to allow for 2
email addresses so I created a field EmailFlag and an option group with 2
values: EmailName1 and EmailName2.
In my regular sql queries, I've modified the statement by using:
EmailName: IIf([EmailFlag]=1,[contacts].[EmailName1],[contacts].[EmailName2])
But I can't figure out how to modify sql embedded in vb to take into account
that EmailName needs to = EmailName1 or EmailName2 depending on the EmailFlag.
EmailName1 is the default, but someone may choose to have EmailName2 as
their primary email address. In any case, I'm trying to make sure that the
email address associated with the correct email flag is not null. I'd
appreicate help modifying the code:
sql = "SELECT Contacts.EmailName FROM ChapterMembers INNER JOIN " +
"Contacts ON ChapterMembers.ContactID = Contacts.ContactID " + "WHERE
(((ChapterMembers.ChapterID)=" + CStr(Me.FindChapter) + ") AND
((Contacts.EmailName) Is Not Null));"
email addresses so I created a field EmailFlag and an option group with 2
values: EmailName1 and EmailName2.
In my regular sql queries, I've modified the statement by using:
EmailName: IIf([EmailFlag]=1,[contacts].[EmailName1],[contacts].[EmailName2])
But I can't figure out how to modify sql embedded in vb to take into account
that EmailName needs to = EmailName1 or EmailName2 depending on the EmailFlag.
EmailName1 is the default, but someone may choose to have EmailName2 as
their primary email address. In any case, I'm trying to make sure that the
email address associated with the correct email flag is not null. I'd
appreicate help modifying the code:
sql = "SELECT Contacts.EmailName FROM ChapterMembers INNER JOIN " +
"Contacts ON ChapterMembers.ContactID = Contacts.ContactID " + "WHERE
(((ChapterMembers.ChapterID)=" + CStr(Me.FindChapter) + ") AND
((Contacts.EmailName) Is Not Null));"