devxlogo

Using Enter To Tab Forward Through User Entry Fields

Using Enter To Tab Forward Through User Entry Fields

When users are comfortable using the Enter key to proceed to the nextfield, you can allow them to continue their old habits. You need very littlecoding to accomplish this. Set the KeyPreview property of the form to True,and include the following code:

 Sub Form_KeyDown (KeyCode As Integer, Shift As Integer)	' To trick the system to think 	' the Tab key was pressed	If KeyCode = 13 Then SendKeys "{TAB}"End SubSub Form_KeyPress (KeyAscii As Integer)	' To eliminate the annoying beep	If KeyAscii = 13 Then KeyAscii = 0End Sub

devx-admin

Share the Post: