Logo 
Search:

MS Office Forum

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds

keypress event help

  Asked By: Almas    Date: Oct 02    Category: MS Office    Views: 567
  

can any one help me key press event in excel, when i preass enter key
i curser need to move one cotrol to another control,

for example if i press enter key in text box curser move to another
text box or another control,below i have return code like this in text
box keypress event

Private Sub TextBox1_KeyDown(ByVal KeyCode As MSForms.ReturnInteger,
ByVal Shift As Integer)
If keyascii = 13 Then
Me.ComboBox1.SetFocus
End If
End Sub

but curser not move from textbox1 to combox1.
pls help me

Share: 

 

1 Answer Found

 
Answer #1    Answered By: Garai Chalthoum     Answered On: Oct 02

I haven't looked for this, but is the key  code of the enter  key 13? It
could just as easily be 11 (LF) or a compound key.

Put in a msgbox call, or similar, to tell you what the code  is that you're
getting when you hit the key - or simply put a break-point on the line and
step it through.

 
Didn't find what you were looking for? Find more on keypress event help Or get search suggestion and latest updates.




Tagged: