Automatic Dropdown of Combo Box

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have read the posts and tried the previous suggestions and it is not working.

I have a combo box that I want to automatically drop down when the field is
selected like when you tab into or Enter Key from a previous field.

I have tried

Me.comboboxname.Dropdown

in both "On Enter" and "Got FOcus" with no change.

Suggestions??
 
Private Sub comboboxname_GotFocus()
Me.comboboxname.Dropdown
End Sub
should certainly work, regardless of how you access the combobox; OnEnter
won't work, I don't think, if you click on the box.

How did you enter the code? By that, I mean, did you select the combobox,
goto Properties - Events the click on OnGotFocus to go to the code editor, or
did you smply go into the code editor and enter your code? Sometimes, using
the second method, Access doesn't "connect" the control and the event code.
If that's what happening here, you can cure this by doing the above; select
the combobox, goto Properties - Events the click on OnGotFocus to go to the
code editor. Then simply exit the code editor and it should work. The only
other thought that comes to mind is that you entered you code, then changed
the name of the combobox. The name on a control's events doesn't
automatically update when you do this, you have to do it manually.

Good Luck!

Linq ;0)>

--
There's ALWAYS more than one way to skin a cat!

Answers/posts based on Access 2000

Message posted via AccessMonster.com
 
Private Sub Town_GotFocus()
Me.Town.Dropdown

End Sub

This is the way it is. Even after closing the database and reopening it, it
will not activate the dropdown.
 
Is "Town" the name of your field-in-table, or the name of your
control-on-form? If both, perhaps Access is confused as to which one you
mean.

Try using a prefix indicating that the control is a combo box -- e.g.,
cboTown.

Also, instead of using the "." (dot), try:

Me!cboTown.Dropdown

Regards

Jeff Boyce
Microsoft Office/Access MVP
 

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

Back
Top