Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 06-03-2012, 06:50 PM
joatmon joatmon is offline KeyCode Conversion Windows 7 64bit KeyCode Conversion Office 2010 64bit
Novice
KeyCode Conversion
 
Join Date: May 2012
Posts: 14
joatmon is on a distinguished road
Default KeyCode Conversion

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!
Reply With Quote
 

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
ost to pst conversion rudihorvath Outlook 0 03-16-2012 07:23 AM
KeyCode Conversion utm to long lat conversion gsrikanth Excel 2 01-17-2012 07:29 AM
KeyCode Conversion Multiple conversion Metamag Word 3 06-20-2011 05:03 PM
KeyCode Conversion pdf to word conversion wordpdf Word 3 05-15-2011 01:58 PM
KeyCode Conversion file conversion ? coltheplumb Excel 1 05-12-2011 01:03 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 04:00 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft