KRB-Bldr,
that's fine, but you should also add, that the valid method only runs, when the user tabs away from the textbox.
If you want such a thing to run interactively while the user types there is the .IncrementalSearch property of eg the listbox or combobox. You bind a list of data to it and while the user types the list will scroll to the match. An incremental search ends, when the user needs more than the time interval defined in _dblclick. In later versions this has a seperate system variable called _incseek.
Consider changing this to 1 or 2 seconds, or only fast typers will be able to make use of the incremental search.
That said it does not apply to the textbox, as that is not reasonly but rather allows editing of values or entering new ones, but there is the InteractiveChange event you can use to react to any letter typed. You can combine that with JRB-Bldrs idea of a Value storing the previous value, but InteractiveChange really just is run, if there is a change, eg not if you simply move around with left or right arrow.
There are also ready to use incremental search textbox classes at Universal Threads Download section, if you don't want to switch to list- or combobox and the native .IncrementalSearch property and mechanism. For example Download-ID: 32394 (
Another note: There is also a similar feature called Autocomplete you can use with a textbox, but that needs data in the format of an autocomplete table to be usable for this way of autocompletion of partly entered values. It may not be applicable here.
Bye, Olaf.