Link to home
Start Free TrialLog in
Avatar of MonkeyPie
MonkeyPieFlag for Australia

asked on

Access VBA listbox value while still typing

I have a form with a bound listbox, with only one column - a string field of job numbers.

While the user types I want to check whether there is no match, and give a message along the lines of "There is no match for this job."

For a text box I would have to use txtField.text on a key press event, as txtField.value does not yet have what has been typed.

For the listbox, the keypress event is being triggered, but cboList.text is still empty after typing my first character.

What should I use to find the value of the listbox so far, on each key press?

Thank you.
SOLUTION
Avatar of mbizup
mbizup
Flag of Kazakhstan image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
The Previous two Experts have got you covered..., so I don't want any points...


Just a note.

Anytime you want something to happen "as you type"
...it can takes a lot of resources.

If the list of values to search will remain relatively small, then no problem.

But as ( ...or if) the list grows, you may notice that it takes longer and longer to work because it has to search more and more records.

Jeffcoachman