Automatic Dropdown of Combo Box

D

DonElston

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??
 
M

missinglinq via AccessMonster.com

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)>
 
D

DonElston

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.
 
J

Jeff Boyce

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
 
Top