Combo Box Behavior

P

Phil M.

I have a combo box that is coded to open immediately when the form opens.
The user can type in part of the word, and scroll to the correct entry using
the arrows and enter button.

When the enter button is pressed, I want the cursor to move to a certain
field in the form, AND I want the combo box to close. Is there any VB code
that can do this?

Thanks
Phil M.
 
K

Kelvin

To move to a spcific field set the focus to that field.

Me.NameOfControl.SetFocus

What do you mean by closing the combo box. If you mean to roll back up, it
should do it automatically. If you mean to make it disappear set the
Visible property to false.

Me.NameOfComboBox.Visible = False

You might have to set this back to True in the form's OnOpen event or else
you won't see it again.

Kelvin
 

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