Avatar of BobRosas
BobRosas asked on

record a keystroke

When the user initiates "keydown" for the txtSSName field, I want the keystroke rembered and added to a dropdown field where it will start auto filling.  This is what I have so far and keycode appears to be a numeric value for the letter entered and it is not working.  I'm connected to a SQL db if that helps.

Objective:  What I want is for the txtSSName to display the Support Staff(SS) for the current client.  However, if the user clicks on txtSSName I want to go to a dropdown field where only the CURRENT SS names are listed.  If I use only the combo box for my form (and filter out Non Current names)  the name doesn't display on the form if the SS is not current.  If there is a better way to do this I'm open for suggestions.  Right now I'm displaying txtSSName field on top of cboSupportStaffLkUpID.

Private Sub txtSSName_KeyDown(KeyCode As Integer, Shift As Integer)
    strKeyCode = KeyCode
    DoCmd.GoToControl "cboPlacementFollowUpBy"
End Sub

Private Sub cboSupportStaffLkUpID_GotFocus()
    cboSupportStaffLkUpID.SelText = strKeyCode
End Sub
Microsoft Access

Avatar of undefined
Last Comment
BobRosas

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
MikeToole

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
Hamed Nasr

If the comboBox list is:
h
hn
hna
hnas

Do you want when typing h the combo to display h
              and when typing hn the comboBox to display hn, and so on
ASKER
BobRosas

Thank you both for your responses.  chr(Keycode) did change the value to what I typed in so I"d be glad to close this question but since it didn't solve my problem I'd be glad to increase points for some continued help.  
In previous testing when I would type in "hnas" for example.  It would display "nas".  It kept leaving off the first letter.  So I thought if I saved off the first letter the rest would work.  However now I get the error "The text you entered isn't an item in the list."  (Even when it is.) Any thoughts?
ASKER
BobRosas

I want to clarify that when I get the message "The text you entered isn't an item in the list."  The first letter (Ex: "H") is the only thing in the field.  So I guess technically that doesn't exist as a choice but that's why I used .selText.  I'm just trying to initiate the auto fill. But somehow I think it's accepting it as the whole entry.  I'd apprecaite any input.
Thanks
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23
SOLUTION
Hamed Nasr

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
ASKER
BobRosas

I think I got it working.
Thank you so much for your patience!