VB Code:
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Private Const CB_ERR = (-1)
Private Const CB_FINDSTRING = &H14C
Private Sub FindMatch(CB As ComboBox, KeyAscii As Integer)
On Error Resume Next
Dim MyBuffer As String
Dim FindIt As Long
MyBuffer = Left(CB.Text, CB.SelStart) & Chr(KeyAscii)
FindIt = SendMessage((CB.hwnd), CB_FINDSTRING, -1, ByVal MyBuffer)
If FindIt <> CB_ERR Then
CB.ListIndex = FindIt
CB.Text = CB.List(FindIt)
CB.SelStart = Len(MyBuffer)
CB.SelLength = Len(CB.Text)
KeyAscii = 0
End If
End Sub
Private Sub Combo1_KeyPress(KeyAscii As Integer)
FindMatch Combo1, KeyAscii
End Sub