Might one ask why you're not using the perfectly serviceable autocomplete options built in to the combobox rather than attempting this rather strange and ever so slightly bonkers method? I can't see how the loop you're using ever resolves itself as it simply reads exactly the same values over and over again (to say nothing of the fact that it appears to be seeking whole texts but is activated by a single key press.