Paddyo
asked on
Return Key as Tab Key
Is there a way to use the Return Key instead of the Tab key to move to the next control without having to trap the key with the individual control events.
THANKS FOR YOU ASSISTANCE
Paul
THANKS FOR YOU ASSISTANCE
Paul
Private Sub Form_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
SendKeys Chr$(9), True
KeyAscii = 0
End If
End Sub
If KeyAscii = 13 Then
SendKeys Chr$(9), True
KeyAscii = 0
End If
End Sub
Ans also, the form's KeyPreview must be enabled (true)...
Let me ask you a question.... WHY? Your users are running your product under windows. In windows the TAB key is used to move from one control to the next. Educate your users.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Hi Paul,
That's a good elaboration on my comment!
alok.
That's a good elaboration on my comment!
alok.
I agree with caraf_g's comment. Tab key is standard for Windows. It also increases productivity (forces users to use two hands for typing)
BTW,
Select Case Index
Case 0 to 8
MyText(Index+1).SetFocus
Case 9
MyText(0).SetFocus
End Select
can be replaced with one line:
MyText((Index+1) Mod 10).SetFocus
BTW,
Select Case Index
Case 0 to 8
MyText(Index+1).SetFocus
Case 9
MyText(0).SetFocus
End Select
can be replaced with one line:
MyText((Index+1) Mod 10).SetFocus
ASKER
One of the reasons I wish to use the Return Key as well as the TAB key is that where there is a lot of numeric input, i.e. an accounting system, the numeric keypad is used. The Tab key is on the other side of the keyboard!! It is quicker to use the Enter Key.
Also - TAB maybe standard but customers are customers - they pay my wages.
Also - TAB maybe standard but customers are customers - they pay my wages.
A good idea is to use a control array. This simplifies the task, so that the code can be written only once for each type of control.
hth
alok.