vb6 how capture enter key press?
Posted on 2006-03-20
I have a VB 6 application in which I have several text boxes on a form. When the user types in a number in the first text box and presses the Enter key, I want the application to set focus to the second text box, etc.
I have done this in previous application to speed up data entry, but now when I try it, it does not seem to work. Below is the code I am using.
Private Sub txtContract_Labor_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then 'User pressed the Enter key
This code below does not even fire off when the enter key is pressed:
Private Sub txtContract_Labor_KeyDown(KeyCode As Integer, Shift As Integer)
Any ideas why it does not work? Thanks.