Our company has the following email address set up in the Global Address Book - "LastName,FirstName". When you select multiple email recipients, they are separated by semi-colons (
. We use MS Outlook through an exchange server.
A database I have created for the issues surrounding a finance application needs to sent out to a 2 people regularly. They are contained in a table called tblUser, containing 3 fields, UserId,LastName,FirstName.
Everything works fine when I run this command,except that the To field of the email shows:
LastName;FirstName where I expected it to show LastName,FirstName. So MS Outlook thinks it is two people, where in fact it is one??
I have tried a number of permutations to create the email address, but still get the same results. Below is the relevant section of the code.
Any thoughts would be appreciated
A database I have created for the issues surrounding a finance application needs to sent out to a 2 people regularly. They are contained in a table called tblUser, containing 3 fields, UserId,LastName,FirstName.
Everything works fine when I run this command,except that the To field of the email shows:
LastName;FirstName where I expected it to show LastName,FirstName. So MS Outlook thinks it is two people, where in fact it is one??
I have tried a number of permutations to create the email address, but still get the same results. Below is the relevant section of the code.
Code:
'-- Combo of names to assign log to
stWho = Me.cboEmail
stWhere = "tblUser.userid = " & stWho & ""
'-- Looks up First Name for email from tblUsers
varFName = DLookup("[FirstName]", "tblUser", stWhere)
'-- Looks up Last Name for email from tblUsers
varLName = DLookup("[LastName]", "tblUser", stWhere)
'Assign names to email address
varTo = varLName & ","
varTo = varTo & varFName