Word VBA >> Keycode conversion

by Randy Dod » Sat, 17 Jul 2004 09:50:30 GMT

Is there a built-in function to convert the keycode
parameter in a keydown or keyup event to the ascii
equivilant? I know how to do it manually and write code
for it, but I couldn't seem to find a built-in converter.


Similar Threads

1. VB Conversion Keywords And .NET Conversion Routines - VB.Net

2. VBA KeyBindings.Add KeyCode not working with f9 but OK with f5- to

3. Tab key not working with textboxes - KeyCode=9 not being recognize

4. Tab key not working with textboxes - KeyCode=9 not being recognized

Hello all,

I have three textboxes that I created by clicking on the textbox icon in the 
control toolbox.  For each of these textboxes I have the following code:

Private Sub TextBox1_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal 
Shift As Integer)
   If KeyCode = 9 Then Me.TextBox2.Activate
End Sub

Private Sub TextBox2_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal 
Shift As Integer)
   If KeyCode = 9 Then Me.TextBox3.Activate
End Sub

Private Sub TextBox3_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal 
Shift As Integer)
   If KeyCode = 9 Then Me.TextBox1.Activate
End Sub

When I click on the first textbox and hit enter, the code does what I want 
it to do i.e. the focus moves the focus from TextBox1 to TextBox2.  But when 
I hit tab again, instead of the focus moving from TextBox2 to TextBox3, a 
tab character is entered in TextBox2.  If I click outside any of the boxes, 
then click in TextBox2 and hit tab, it works fine again i.e. the focus moves 
from TextBox2 to TextBox3.  Why doest my focus move from TextBox2 to 
TextBox3 without going through the deselcting and selecting operation with 
the mouse?  How can I fix it?

Please help.
SS 


5. Tab key not working with textboxes - KeyCode=9 not being recog

6. I have a keycode for Office Home and Student from a recent purchas

How do I install an updated version of windows on my laptop when i have the 
keycode form a recent purchase on my pc?

7. Find Keycode for Office 2003 Home - Microsoft Office

8. I lost my keycode to office when I moved