IntelligentCan1517
New Member
- Joined
- Jul 7, 2022
- Messages
- 2
- Office Version
- 2010
- Platform
- Windows
Hello,
Can anyone help me with making combo box search dynamic? I have thousands of records that I feed in my combo box (one-dimensional array) and it appears all fine. I want to make the drop down list dynamic as user starts type in. The problem is the combo box change event takes too long as it is cycling through each item in the list and crashes down. What I want to achieve is leave the combo box blank until the user has typed 3 or 4 characters. By that time there should be less matches so it would be quick enough to work. Does anyone has some ideas or examples?
My attempt code is below: (I get an error Run time error 9)
Private Sub ComboBox1_Change()
Dim i As Long
For i = LBound(t_array) To UBound(t_array)
If Len(ComboBox1.Value) >= 4 Then
Me.ComboBox1.AddItem t_array(i)
End If
Next i
End Sub
Can anyone help me with making combo box search dynamic? I have thousands of records that I feed in my combo box (one-dimensional array) and it appears all fine. I want to make the drop down list dynamic as user starts type in. The problem is the combo box change event takes too long as it is cycling through each item in the list and crashes down. What I want to achieve is leave the combo box blank until the user has typed 3 or 4 characters. By that time there should be less matches so it would be quick enough to work. Does anyone has some ideas or examples?
My attempt code is below: (I get an error Run time error 9)
Private Sub ComboBox1_Change()
Dim i As Long
For i = LBound(t_array) To UBound(t_array)
If Len(ComboBox1.Value) >= 4 Then
Me.ComboBox1.AddItem t_array(i)
End If
Next i
End Sub