Link to home
Create AccountLog in
Avatar of chestera
chestera

asked on

Search list box

Hi EE
I have the following
Dim i As Long
Dim Intnum
Intnum = Me!txtOrg
With Me!lstCompany
    For i = 0 To .ListCount - 1
        If .Column(2, i) Like Intnum Then
            .Selected(i) = True
            Exit For
        End If
    Next i
End With
Me!lstCompany.SetFocus

example. I have a list box of client details I need to search for names beginning with first two or three characters of a name. I have a name called Donards and would like to enter Don for a search. With the above code I have to enter the full name Donards for it to work.
Any help appreciated

chestera
ASKER CERTIFIED SOLUTION
Avatar of Ryan Chong
Ryan Chong
Flag of Singapore image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of chestera
chestera

ASKER

Ryan Chong

Thank you Ryan works like a charm

lan