Listbox and textbox update (1 Viewer)

jfgambit

Kinetic Card Dealer
Local time
Today, 03:12
Joined
Jul 18, 2002
Messages
798
I have a listbox (based on a Like "*" query) on a form that needs to update when a user enters names into a textbox on the same form. Here's the catch, the listbox needs to update after each letter is entered. In otherwords, if I am looking up SMITH, after I type "S" all the names like "S" appear, when I type "M" all the names with "SM" come up...etc, etc.

I have tried the OnChange Event by adding me.refresh, but the next letter is overwritten in the textbox and instead of looking up "SM" it only has "M". I have aslo tried me.lstboxname.requery, but the listbox does not update.

Any ideas??
:confused:
 

jfgambit

Kinetic Card Dealer
Local time
Today, 03:12
Joined
Jul 18, 2002
Messages
798
yes, but nothing happens
 

jfgambit

Kinetic Card Dealer
Local time
Today, 03:12
Joined
Jul 18, 2002
Messages
798
Changed the Event code to:

Private Sub txtSearch_Change()
Me.Refresh
Me.txtSearch.SelStart = Me.txtSearch.SelLength
End Sub

and it works fine...

Thanks
 

Pat Hartman

Super Moderator
Staff member
Local time
, 22:12
Joined
Feb 19, 2002
Messages
43,603
Why not switch to a combo. The behaviour that you are seeking is the default behaviour for combos.
 

Users who are viewing this thread

Top Bottom