
10-31-2001, 01:08 PM
|
|
Senior Contributor
Retired Leader * Expert *
|
|
Join Date: Apr 2001
Location: canada, quebec
Posts: 1,334
|
|
Re: Typing into a combo box
|
isn't this used by default in the combobox? as soon as you type something, it shows the first corresponding item in the list...
on the other hand it doesn't select the given item when it loses focus, to do so you can try something like this
Private Sub cmbListeClient_LostFocus()
If Trim(cmbListeClient.Text) <> "" Then
Dim i As Integer
For i = 0 To cmbListeClient.ListCount
If UCase(Left(cmbListeClient.List(i), Len(cmbListeClient.Text))) = UCase(cmbListeClient.Text) Then
cmbListeClient.ListIndex = i
Exit For
End If
Next i
End If
End Sub
this example is the one i use for the combobox where i have a list of client
|
__________________
Still tons to learn!
|