Array is passing values with double double quotes to another procedure
Posted on 2012-03-20
I am working on taking a string of user ids in a text box, changing themto an array adn then passing each userid to a procedure. However, I don't know why I keep getting double double quotes when it passes the aarry values. What appears in the text box is in the fomat of "ssmith", "jones", "brown" This procedure is in VBA behind an Access 2003 form.
'Create email and text to Administration with user's suggestion
On Error GoTo ErrorHandler
Dim EmailBody As String
Dim ToEmailAddress As String
Dim FromEmailAddress As String
Dim strSelect As String
Dim strCriteria As String
Dim strSplit() As String
Dim i As Integer
FromEmailAddress = "email@example.com"
ToEmailAddress = "firstname.lastname@example.org"
strCriteria = Me.txtCriteria
strSplit = Split(strCriteria, ", ")
For i = LBound(strSplit) To UBound(strSplit)
EmailBody = BuildEmailBody(strSplit(i)) 'Sends string with double double quotes - ""ssmith"" - WHY??
If SendValidationEmailExchange(FromEmailAddress, ToEmailAddress, "Employee Validation", EmailBody) Then
MsgBox "Email has been sent.", vbCritical + vbOKOnly, "Email Has Been Sent'"
DoCmd.Close acForm, Me.Name