value of a text box

G

Guest

I have a list box loaded with values from a SQL Statement as the rowsource.
I would like to be able to narrow that list down by typing into a text box,
and have the query run a "like" statement against the value in the text box.
I am trying to run a requery action for the list box on the "on change" event
of the text box, so that every time a new character is typed in, the values
in the listbox will be narrow to contain the values in the list box. I
don't think that the SQL can see what is in the box, which seems to have a
null value, since the text box isn't updated. how can I force the text box
to update it's value?
 
P

pietlinden

I have a list box loaded with values from a SQL Statement as the rowsource.
I would like to be able to narrow that list down by typing into a text box,
and have the query run a "like" statement against the value in the text box.
I am trying to run a requery action for the list box on the "on change" event
of the text box, so that every time a new character is typed in, the values
in the listbox will be narrow to contain the values in the list box. I
don't think that the SQL can see what is in the box, which seems to have a
null value, since the text box isn't updated. how can I force the text box
to update it's value?

unless you need the multi-select property of the listbox, why not just
use a combobox and set the LimitToList property to True? Otherwise,
this is going to take a fair amount of work, and could be a complete
waste of time...
 
G

Guest

I had thought of that, however, the multiselect property would be very
valuable. It seemed to be very easy in concept, but turns out in reality to
be more difficult. One approach I tried was to change the focus off the text
box on change, then put the focus back on. This solved the problem of
setting the value of the test box to what had been typed, but now the entire
contents of the box are selected, and any further typing clears the box. Is
there a way of going to the end of the text after giving it the focus?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top