combo box programming

J

John134

I have a combo box in which I have coded a dropdown event, i.e.
combo1.dropdown, after entering some text. However, after updating the combo
box the dropdown box does not disappear. I would like to add code to my
combo box update event to make it go away. Can anyone suggest code to do
that?

John134
 
K

Ken Snell \(MVP\)

There is no code that will cause the dropdown list to go away. You must move
the focus away from the combobox in order to have the dropdown list go away.
 
J

John134

Thanks for your reply, Ken. I tried adding code to change the focus but it
didn't work. However, I solved the problem. I learned that the code for
changing the focus cannot be part of a procedure for the combo box event.
But, by adding the dropdown code in another procedure (to open the form), the
problem of not being able to remove the dropdown list, upon updating the
combox box, went away .

John134
 
K

Ken Snell \(MVP\)

Comments inline....
--

Ken Snell
<MS ACCESS MVP>


John134 said:
Thanks for your reply, Ken. I tried adding code to change the focus but
it
didn't work.

Depends upon which event of the combo box you used. If you used GotFocus or
Enter, then yes, you'll have a problem.
However, I solved the problem. I learned that the code for
changing the focus cannot be part of a procedure for the combo box event.

If you use the AfterUpdate event of the combobox, you can move the focus
from the combobox. However, if the user types in an entry instead of
clicking on it in the dropdown list, and then uses Enter or Tab to "finish"
the entry, the normal Tab Order will prevail as the focus moves to the next
control, and any "set focus" code in the AfterUpdate event will not be
successful.
 

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