I'm trying to fill a textbox with employee names, matching it to their clock number from two arrays. One contains the clock numbers, and the other their names, by matching the idx number of the arrays. What I'm doing is matching the index from the ClockNumArray to EmployNameArray.
It works somewhat, but it's not perfect, my code is below;
Private Sub ClockNumberImput_TextChanged(sender As Object, e As EventArgs) Handles ClockNumberImput.TextChanged
Dim Idx, i As Integer
'**********************************
For i = 0 To UBound(ClockNumArray)
If InStr(ClockNumArray(i), Me.ClockNumberImput.Text) > 0 Then
Idx = i
Exit For
End If
Next i
If Me.ClockNumberImput.Text = vbNullString Then
Me.EmployeeName.Text = vbNullString
Else
Me.EmployeeName.Text = EmployNameArray(Idx)
End If
End Sub
It works somewhat, but it's not perfect, my code is below;
Private Sub ClockNumberImput_TextChanged(sender As Object, e As EventArgs) Handles ClockNumberImput.TextChanged
Dim Idx, i As Integer
'**********************************
For i = 0 To UBound(ClockNumArray)
If InStr(ClockNumArray(i), Me.ClockNumberImput.Text) > 0 Then
Idx = i
Exit For
End If
Next i
If Me.ClockNumberImput.Text = vbNullString Then
Me.EmployeeName.Text = vbNullString
Else
Me.EmployeeName.Text = EmployNameArray(Idx)
End If
End Sub