B
Brian
I have this code for the KeyPress event of all my combo boxes:
Private Sub <ControlName>_KeyPress(KeyAscii As Integer)
If Len(ActiveControl.Text) = 0 And KeyAscii <> 9 And KeyAscii <> 27 Then
ActiveControl.Dropdown 'dropdown on first character unless it is TAB/ESC
End Sub
Combined with LimitToList & AutoExpand both set to True, the net effect is
that the control drops down on the first keystroke, allowing greater
visibility of the list for the user.
Here is the problem: when I type an entry in the prior combo box (i.e . per
the tab order) and press Tab, it correctly moves the focus to this empty
control without dropping down; however, when I type an entry in the prior
combo box and press Enter, it moves to this control and drops down,
presumably due to my code above.
It seems that 1) the Enter keystroke is somehow being applied to the
following control, not the current control and 2) I cannot intercept the
Enter keystroke to prevent this behavior.
Ideas? (I mean, besides telling the users to stick to the Tab key or just
living with the box dropping down when they didn't intend that to happen).
Private Sub <ControlName>_KeyPress(KeyAscii As Integer)
If Len(ActiveControl.Text) = 0 And KeyAscii <> 9 And KeyAscii <> 27 Then
ActiveControl.Dropdown 'dropdown on first character unless it is TAB/ESC
End Sub
Combined with LimitToList & AutoExpand both set to True, the net effect is
that the control drops down on the first keystroke, allowing greater
visibility of the list for the user.
Here is the problem: when I type an entry in the prior combo box (i.e . per
the tab order) and press Tab, it correctly moves the focus to this empty
control without dropping down; however, when I type an entry in the prior
combo box and press Enter, it moves to this control and drops down,
presumably due to my code above.
It seems that 1) the Enter keystroke is somehow being applied to the
following control, not the current control and 2) I cannot intercept the
Enter keystroke to prevent this behavior.
Ideas? (I mean, besides telling the users to stick to the Tab key or just
living with the box dropping down when they didn't intend that to happen).