This tip shows how to simulate the look of an Oultlook address book records selection.
Private Sub Text1_Change() Dim intI As Integer Dim strTmp As String strTmp = Text1.Text intI = MatchList(strTmp, List1) 'Call the Function If intI >= 0 Then List1.ListIndex = intI List1.TopIndex = intI End If End Sub Function MatchList(strIn As String, listIn As ListBox) As Integer '------------------------------------------------------------ 'Function to match the typed string from an existing list box 'NOTE : The list should be sorted '------------------------------------------------------------ Dim blnMatchFound As Boolean Dim intI As Integer Dim intstrLength As Integer Dim strFirstLetter As String intstrLength = Trim(Len(strIn)) strFirstLetter = UCase(Left(Trim(strIn), 1)) '*** Search for exact match *** For intI = 0 To listIn.ListCount - 1 If Left(UCase(listIn.List(intI)), intstrLength) LikeUCase(strIn) Then blnMatchFound = True MatchList = intI Exit Function End If Next '*** Search for After/Before strings (if no match has beenfound) *** If blnMatchFound = False Then For intI = 0 To listIn.ListCount - 1 If Left(UCase(listIn.List(intI)), 1) >UCase(strFirstLetter) Then blnMatchFound = True MatchList = intI Exit Function Else blnMatchFound = True MatchList = intI End If Next End If End Function Private Sub Form_Load() List1.AddItem