Okay,
My client is used to a UNIX system in which during data entry to move from field to field they press the Enter Key. I know it's not coding correct to assign the Enter key as the tab key, but this is the way they want it.
Here's my code:
Private Sub txtFirstName_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
SendKeys "{tab}"
KeyAscii = 0
End If
End Sub
Now this works, however I noticed that if I hit the enter key too fast to get through my fields my keyboard locks up and I have to go into control panel and change a keyboard option to get it to work again. When I do it slowly, I notice that the num lock light blinks off and then on whenever I press enter to go through the fields.
My question is (seeing that this code is provided by Microsoft is there a better way to change the enter key default behavior on a control, or why is my keyboard locking up the way it is?
My client is used to a UNIX system in which during data entry to move from field to field they press the Enter Key. I know it's not coding correct to assign the Enter key as the tab key, but this is the way they want it.
Here's my code:
Private Sub txtFirstName_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
SendKeys "{tab}"
KeyAscii = 0
End If
End Sub
Now this works, however I noticed that if I hit the enter key too fast to get through my fields my keyboard locks up and I have to go into control panel and change a keyboard option to get it to work again. When I do it slowly, I notice that the num lock light blinks off and then on whenever I press enter to go through the fields.
My question is (seeing that this code is provided by Microsoft is there a better way to change the enter key default behavior on a control, or why is my keyboard locking up the way it is?