Jobs
Author: Sqares Solutions Company Date Submitted: 7/1/2005 Category: Forms Compatibility: VB 6 This code has been accessed 6006 times.
Email Yourself this snippet:
No declarations
Code
Private Sub TypeAhead(ctlCombo As ComboBox) Dim i As Integer, iPos As Integer If ctlCombo.Text > cSpace0 Then For i = 0 To ctlCombo.ListCount - 1 If InStr(LCase(ctlCombo.List(i)), LCase(ctlCombo.Text)) = 1 Then iPos = Len(ctlCombo.Text) ctlCombo.Text = ctlCombo.List(i) If (Len(ctlCombo.Text) - iPos) > 0 Then ctlCombo.SelStart = iPos ctlCombo.SelLength = Len(ctlCombo.Text) - iPos End If Exit For End If Next End If End Sub