Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27348

Auto fill textbox from array

$
0
0
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

Viewing all articles
Browse latest Browse all 27348

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>