Drop-Down List

P

PPCO

Wondering if there's a way for a list to automatically drop down when a combo
box is clicked on? Thanks
 
A

Al Campagna

PPCO,
Use the Click event (ex. cboComboBox)
Private Sub cboComboBox_Click()
cboComboBox.Dropdown
End Sub
or...
Try the Enter event when you tab into the combobox
Private Sub cboComboBox_Enter()
cboComboBox.Dropdown
End Sub
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."
 
P

PPCO

That's odd, seems like it should work, but didn't do anything. Tried a couple
variations of it as well.
Here's my code:

Private Sub Previous_Record_Click()
On Error GoTo Err_Previous_Record_Click


DoCmd.GoToRecord , , acPrevious

Exit_Previous_Record_Click:
Exit Sub

Err_Previous_Record_Click:
MsgBox Err.Description
Resume Exit_Previous_Record_Click

End Sub
Private Sub NEXT_RECORD_Click()
On Error GoTo Err_NEXT_RECORD_Click


DoCmd.GoToRecord , , acNext

Exit_NEXT_RECORD_Click:
Exit Sub

Err_NEXT_RECORD_Click:
MsgBox Err.Description
Resume Exit_NEXT_RECORD_Click

End Sub
Private Sub EXIT_FORM_Click()
On Error GoTo Err_EXIT_FORM_Click


DoCmd.Close

Exit_EXIT_FORM_Click:
Exit Sub

Err_EXIT_FORM_Click:
MsgBox Err.Description
Resume Exit_EXIT_FORM_Click

End Sub

Private Sub UOM_Click()
UOM.Dropdown
End Sub
 
B

Bob Vance

Try this OnClick of control

DoCmd.Hourglass True
Me.combobox.Requery
Me.combobox..SetFocus
Me.combobox..Dropdown
DoCmd.Hourglass False

Regards Bob
 
B

Bob Vance

Oops
DoCmd.Hourglass True
Me.combobox.Requery
Me.combobox.SetFocus
Me.combobox.Dropdown
DoCmd.Hourglass False
 
A

Al Campagna

PPCO,
Yes, it should work.
Did you try the same code on the combo's OnEnter event?
Any luck with that?
Add a Beep to the code to make sure it's firing.
**Make sure you have [Event Procedure] in the OnClick and/or OnEnter
property box.
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."
 
P

PPCO

The On Enter worked. Thanks!

Al Campagna said:
PPCO,
Yes, it should work.
Did you try the same code on the combo's OnEnter event?
Any luck with that?
Add a Beep to the code to make sure it's firing.
**Make sure you have [Event Procedure] in the OnClick and/or OnEnter
property box.
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."

PPCO said:
That's odd, seems like it should work, but didn't do anything. Tried a
couple
variations of it as well.
Here's my code:

Private Sub Previous_Record_Click()
On Error GoTo Err_Previous_Record_Click


DoCmd.GoToRecord , , acPrevious

Exit_Previous_Record_Click:
Exit Sub

Err_Previous_Record_Click:
MsgBox Err.Description
Resume Exit_Previous_Record_Click

End Sub
Private Sub NEXT_RECORD_Click()
On Error GoTo Err_NEXT_RECORD_Click


DoCmd.GoToRecord , , acNext

Exit_NEXT_RECORD_Click:
Exit Sub

Err_NEXT_RECORD_Click:
MsgBox Err.Description
Resume Exit_NEXT_RECORD_Click

End Sub
Private Sub EXIT_FORM_Click()
On Error GoTo Err_EXIT_FORM_Click


DoCmd.Close

Exit_EXIT_FORM_Click:
Exit Sub

Err_EXIT_FORM_Click:
MsgBox Err.Description
Resume Exit_EXIT_FORM_Click

End Sub

Private Sub UOM_Click()
UOM.Dropdown
End Sub
 
P

PPCO

Further down on the form, I have a sub form that also has a drop down list.
Because it's tab index is 1, if I use the on enter, the list drops down from
the sub form as soon as go to the first drop down list. Then it won't drop
down when I get down to the sub-form. Wonder what might be causing that?
Thanks again!

PPCO said:
The On Enter worked. Thanks!

Al Campagna said:
PPCO,
Yes, it should work.
Did you try the same code on the combo's OnEnter event?
Any luck with that?
but didn't do anything.
Add a Beep to the code to make sure it's firing.
**Make sure you have [Event Procedure] in the OnClick and/or OnEnter
property box.
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."

PPCO said:
That's odd, seems like it should work, but didn't do anything. Tried a
couple
variations of it as well.
Here's my code:

Private Sub Previous_Record_Click()
On Error GoTo Err_Previous_Record_Click


DoCmd.GoToRecord , , acPrevious

Exit_Previous_Record_Click:
Exit Sub

Err_Previous_Record_Click:
MsgBox Err.Description
Resume Exit_Previous_Record_Click

End Sub
Private Sub NEXT_RECORD_Click()
On Error GoTo Err_NEXT_RECORD_Click


DoCmd.GoToRecord , , acNext

Exit_NEXT_RECORD_Click:
Exit Sub

Err_NEXT_RECORD_Click:
MsgBox Err.Description
Resume Exit_NEXT_RECORD_Click

End Sub
Private Sub EXIT_FORM_Click()
On Error GoTo Err_EXIT_FORM_Click


DoCmd.Close

Exit_EXIT_FORM_Click:
Exit Sub

Err_EXIT_FORM_Click:
MsgBox Err.Description
Resume Exit_EXIT_FORM_Click

End Sub

Private Sub UOM_Click()
UOM.Dropdown
End Sub


:

PPCO,
Use the Click event (ex. cboComboBox)
Private Sub cboComboBox_Click()
cboComboBox.Dropdown
End Sub
or...
Try the Enter event when you tab into the combobox
Private Sub cboComboBox_Enter()
cboComboBox.Dropdown
End Sub
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your
life."

Wondering if there's a way for a list to automatically drop down when a
combo
box is clicked on? Thanks
 

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