combo box programming

  • Thread starter Thread starter John134
  • Start date Start date
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
 
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.
 
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
 
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.
 
Back
Top