Combo box

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

Guest

Hi,

I have a combo box with two options: "AS1" and "AS2". The combo box is
bound to a text field and whenever the user types in "A" or "AS", "AS1" pops
up as the default. Is there anyway for the user to just hit "1" and then
"Tab" (or "Enter") and the combo box will recognize it as "AS1" (or
similarly, hit "2" and the combo box will recognize it as "AS2")?

I still want the user to have the option of typing in the entire "AS1" or
"AS2" so I can't just change the value list to "1" and "2"

Thanks!!!
 
Wtih only 2 options, why not just use a pair of Toggle Buttons in an Option
Group instead? That would be easier for the user.
If you must do this, how about seeing if the Keypress event might do it for
your?
If the user presses 1 or 2, then set the value accordingly and move the
focus. I considered the Change event, but the problem there is that it fires
for every keystroke and also fires if you change the value in VBA. This can
cause weird behaviour.
 
The Keydown event worked perfectly! thanks.

Klatuu said:
Wtih only 2 options, why not just use a pair of Toggle Buttons in an Option
Group instead? That would be easier for the user.
If you must do this, how about seeing if the Keypress event might do it for
your?
If the user presses 1 or 2, then set the value accordingly and move the
focus. I considered the Change event, but the problem there is that it fires
for every keystroke and also fires if you change the value in VBA. This can
cause weird behaviour.
 
Back
Top