Help with combobox and hotkeys....

gabo

Registered User.
Local time
Yesterday, 18:20
Joined
Apr 29, 2004
Messages
11
Hi, I have a combobox with two values Male and Female, what I want to do is to create a kind of hotkey, so when te combobox has the focus if you press the M key the value set to male and with the F key the value sets to female, but I didn't find how to do that could you please help me???

thank you

And I want to say that this is a great site
 
I believe that you will need to use the forms KeyPress event. Search the help files on how to use it. If you search the forum for "KeyPress" and my user name "ghudson" you will find some code on how to use the event. You will have to trap for the M and F key and set the value of the combo box to Male or Female based on which key the user pressed.
 
Problem....

I look around for the code and I use this:

Private Sub Combo98_KeyPress(KeyAscii As Integer)
If KeyAscii = 109 Then
Me.Sexo.Value = "Masculino"
End If
End Sub

but when I press the M key access senda an error message that the value is not on the list
 
Am I missing something here?

Access does this automatically, assuming that your combo is displaying the "Male" & "Female" options.

Simply ensure that your combo box property "Auto Expand" is set to "YES"

This will result in the effect you are after.
 
thank you.....

Thank you bradcccs that was exactly my problem :cool:
 

Users who are viewing this thread

Back
Top Bottom