I have a textbox on a userform that I am trying to work with the KeyDown event. I'm trying to capture the user's input using the KeyCode. I thought that KeyCode would just return ASCII values, but this is proving not to be the case. Take this very simple code for illustration:
Code:
Private Sub txtAnswer_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
MsgBox (KeyCode)
End Sub
If I enter the number "3" on the keyboard, what comes out is the number 99. I was expecting the number 51 to appear since that is the ASCII value for the character "3".
Can anybody explain this behavior to me? It's probably pretty simple, but I don't know how to translate this.
Thank you!