KeyDown (Down Arrow) ignores ALT+Down Arrow for combobox drop down

Fernando

Registered User.
Local time
Yesterday, 22:24
Joined
Feb 9, 2007
Messages
88
I have this on forms keydown event:
Code:
Select Case KeyCode
   Case vbKeyDown
   ' Go to next record
End Select
But when a combo box has the focus and the user just wants to dropdown it using Alt+DownArrow . It will take him to the next record. And when he wants to go tru the combo box options using the arrows it will also take him to the next record. Any Ideas? Thanks in advance.
 
You need to tell Access to only go to the next record if the current control with focus is not your combobox:
Code:
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
Select Case KeyCode
   Case vbKeyDown
   If Screen.ActiveControl <> YourComboboxName Then
      ' Go to next record
   End If
End Select
End Sub
 
thanks for the reply! however i would like them to go to the next record if the combo box has the focus.

So while the combobox has the focus:
if the user presses DownKey then go to next record.
If he presses ATl+DownKey then dropdown
If it is dropeddown and presses DownKey go to next item in the combo box list

Again thanks, any ideas?
 

Users who are viewing this thread

Back
Top Bottom