I don't have a KB article but here is some code that should get you
started - the textbox is named 'Text2' and the listbox is named 'list0'.
Note that the "text" property of the control is only available while the
control has focus and it's value is what is currently typed into the
control.
Private Sub Text2_Change()
Dim inti As Integer
Dim fEnd As Boolean
inti = 0
Do Until fEnd
If Left(Me.List0.Column(1, inti), Len(Me.Text2.Text)) = Me.Text2.Text
Then
fEnd = True
Me.List0.SetFocus
Me.List0.ListIndex = inti
' put focus back to the textbox
Me.Text2.SetFocus
Me.Text2.SelStart = Len(Me.Text2 & "")
Else
inti = inti + 1
If inti > Me.List0.ListCount Then
fEnd = True
End If
End If
Loop
End Sub
--
Sandra Daigle [Microsoft Access MVP]
Please post all replies to the newsgroup.
There was a KB article that shows how to use a textbox on a form to
select an item in the listbox. As the user types in the value, a
matching value is selected in the listbox. I cannot find that
article. Does anyone know where it is?