Strange behaviour in search code

P

Piri

I have a form used for searching a product list.
The operator uses a text field with an OnChange event that, with the
entry of each character updates a viewable list box in the form. Each
time the operator enters character the code passes the focus to the
list, re-queries it, and then passes the focus back to the list box
ready for the next character input, and so on.

When the search gets to the point of the operator recognising the item
sought they can click the item on the list for more information. This
works very well. But there is an issue with the letter "i" - when it
is used as the first character in the search we get the error message
"Runtime error 2110 - cannot move the focus to the control
'lstResults'. This only occurs with the letter "i" being the first
character in the search.

Forms!frmSearch4NewParts!lstResults.SetFocus ' << the code stops
here.
Forms!frmSearch4NewParts!lstResults.Requery
.....pass focus back to search text field etc.

What actually happens is that the form itself drops the focus,
therefore the lstResults control cannot receive the focus as expected.
I cannot see the focus on any other form open at that time. I have
searched all the code for any key code event involving the letter "i"
and cannot find anything.


Any thoughts appreciated.

Piri
 

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