List Box search

  • Thread starter Thread starter Annemarie
  • Start date Start date
A

Annemarie

Any help, advice or tips would be appreciated. I have a
form with a list box. The lsit box is connected to an
option box. Depending of the choice of the user the
underlying info on the list box changes. This is
working. The user click in a column of the list box and
starts typing. The way a list box works is that if the
user clicks example A it will go to the first word that
starts with that letter and then if the user type B it
goes to the next word with that letter. What I want it to
do it search for a word that starts with ab, rather than
look for a new word with each key stroke. Someone like a
combo box works. Does anyone have any ideas?

Thanks very much..........Annemarie
 
Annemarie,

Since this capability is natural for a ComboBox, why not use one of them
instead of a ListBox?

If you really need to do what you are trying to do, the approach would be to
capture the KeyStrokes in the Keypress Event of the ListBox and refilter it
to only include the letters typed so far as the starting letters of the
available candidates in your recordset. A bit laborious, but in common use,
especially in larger recordsets.

Gary Miller
 
Back
Top