<Ap******@gmail.comwrote in message
news:11**********************@v45g2000cwv.googlegr oups.com...
>I am working on a lookup form, where the user will enter LastName
FirstName and check for duplicates. I have a list box that is bound to
a table of 200 members. After the user enters the name, I would like
the Listbox to automatically display the user found at the top row and
of course have the remaining members displayed alphabeticallly below
it. Actually, regardless of duplicates, I would like the ListBox to
display the closest name found alphabetically at the top.
List Boxes purpose for existence is to allow the user to select a value, not
for displaying values, and they don't work in the way you describe. They
display the values in the order they are retrieved by the Row Source. You
could jump through some hoops, add an extra field to the table, set it after
selection, and... well, it's probably not worth the effort.
Why don't you use a Combo Box? With the AutoExpand property set (and it is
set as the default), will scroll to the first matching entry... it'll be a
lot better, in most cases, than requiring the user to type in the name and
then using a control intended for selection to display it. If you want it to
work more-or-less like a List Box, you set the Limit to List property of the
Combo Box to Yes.
Larry Linson
Microsoft Access MVP