Combo box list remaining open when lost focus

suepowell

Registered User.
Local time
Today, 02:42
Joined
Mar 25, 2003
Messages
282
HI All,

This is an odd problem.

I have a combo box to select parts. This form is a subform, which is a subform of another form.

When I select a part in the combo box and there is no record in the next from up I get an error (not surprisingly!).

I want to be able to trap this error and tell the user to enter a date in the next form up ( which create a record and all's well).

I can trap the error and transfer focus to the correct box for the user to create the record. The problem I have is that the combo box remains with its list open even though the form showing behind it is the new opne I have transfered the focus to and not the one the combo box belongs on.
The combo box disappears when I click somewhere on the newly opened form, but not when clicking on the field that now has the focus.

So after this complicated explanation my question is:

How can I close the list of a combo box from within code when I move the focus away from it. I've tried help but I'm not sure how to even ask the question.

Thanks in anticipation.

Sue
 
There is a short cut (F4) that when pressed expands the combo box that has the focus. It also collapes it if it is currently expanded. So on the lost focus you could use the Sendkeys F4 meothodology to collapse the combo box.

CodeMaster::cool:
 
Hi,

Thanks for that I'll give it a go.

The thing I like about this forum is that the most obscure questions get answered, and you just can't find that sort of answer in the help because you don't know enough to ask the right questions.

Thanks Again
 

Users who are viewing this thread

Back
Top Bottom