|
-
Aug 8th, 2000, 09:05 AM
#1
Thread Starter
Junior Member
I know it must be the abc of programing but, can somebody
tell me how can i make, so when i press enter in a
textbox then other textbox getfocus???
-
Aug 8th, 2000, 09:09 AM
#2
Fanatic Member
Code:
Public Sub TextBox1_KeyPress(KeyAscii As Integer)
' Check if return has been pressed
If KeyAscii = vbKeyReturn Then TextBox2.SetFocus
End Sub
-
Aug 8th, 2000, 09:17 AM
#3
Thread Starter
Junior Member
Thanks
Thanks Stevie it worked perfectly!!
-
Aug 8th, 2000, 10:12 AM
#4
Just an a idea.
What you can do if you got multi textboxes.
Code:
Public Sub TextBox_KeyPress(Index As Integer, KeyAscii As Integer)
' Check if return has been pressed
If KeyAscii = vbKeyReturn Then TextBox.Item(Index + 1).SetFocus
End Sub
Just create the indexes on it. 
Code:
TextBox.Index = 0 'ext, ext.
-
Aug 8th, 2000, 11:22 AM
#5
...or if you don't have the text boxes in an array just change the Return to a Tab
Code:
Public Sub TextBox_KeyPress(KeyAscii As Integer)
If KeyAscii = vbKeyReturn Then
KeyAscii = 0
SendKeys "{TAB}"
End If
End Sub
Good luck!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|