I have a weird issue. I have a textbox where I paste info from our ticketing system where I hope to validate the user in Active Directory and other stuff. Within the pasted information, I have a username and occasionally a user-id. What is weird is, I parse the Last Name and First Name and store them as String Fields. I pass those two fields to a function that does the Active Directory query. I fail to make a hit in Active Directory. But if I copy directly from the textbox to a form that accepts the first Name and Last name and call the same function I will make a hit from Active Directory. I verified the exact length of names are correct. As far as I know, I am not passing any white characters. Any ideas what I am doing wrong or how to resolve this?
The code to put the First Name and Last Name to fields and then make the call to check Active Directory. This is the part where I extract the names correctly, but can't find the entry in Active Directory.
Idx = InStr(txtPaste.Text, "Voalte.")
Work = Mid$(txtPaste.Text, Idx + 8, Len(txtPaste.Text))
Temp = LTrim(Work)
FirstName = RTrim(Left(Temp, InStr(1, Temp, " ") - 1))
LastName = RTrim(Mid(Temp, InStr(Temp, " ") + 1))
MsgBox "First Name: " & FirstName & " Len: " & Len(FirstName) & " /
" & "Last Name: " & LastName & " Len: " & Len(LastName)
txtADUserID.Text = GetID(LastName, FirstName)
DoEvents
MsgBox "ID: " & txtADUserID.Text
txtADUserName.Text = FirstName & " " & LastName"
I have a form that accepts the first and last name and calls the GetID function. This works
fFirstname = txtFirstName.Text
fLastName = txtLastName.Text
txtADUserName.Text = fFirstname & Space(1) & fLastName
txtADUserID.Text = GetID(fLastName, fFirstname)
If Len(txtADUserID.Text) = 0 Then
txtADUserID.Text = "User Not Found"
End If
The txtADUserName and TXTADUserID are fields on the form.
This is the data I am parsing.
IAM Application Request for Voalte One - v3.3
Requested by Date: 9/29/2021 Requested for: - 1 - John Doe (No Employee Number);
Please provide the name of a someone you would like this user's access "mirrored" after in Voalte. Fred Flintstone