Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do you make the cursor move from top to bottom (text boxes)?

Status
Not open for further replies.

vbstudent

Programmer
Sep 17, 1999
2
US
I am working on a data entry program for a project, and don't know how to make the cursor move from the top text box downward. Any suggestions? Thanks!
 
you need to set your tab controles so that when they hit the Tab key the cursor moves form box to box 8)
 
Or you can go to the next text box when [ENTER] is pressed with...<br>
<br>
Private Sub Text1_KeyPress(KeyAscii As Integer)<br>
If KeyAscii = 13 Then SendKeys "{TAB}"<br>
End Sub<br>
<br>
There are only a few keyboard events you can't intercept and control. Have fun.<br>

 
Lapomarc is correct but &lt;grin&gt; he/she forgot to mention that you have to set in TabIndex property on each screen field. This determines the order in which you move around the fields with the TAB key.<br>
<br>
(Alt255 is quite right as well - given the TabIndex thing)<br>
<br>
Mike<br>
---<br>
Mike_Lacey@Cargill.Com<br>

 
I have to build data entry screens all the time as I work at a data warehouse. I like alt255's solution better and actually employ it a lot (vbKeyReturn) because in a data entry enviroment, using the mouse is shyed away from as it actually slows 'data entry personnel' down. Stick to the keypad if you can!
 
Quick tip.<br>
Start with the last textbox and work backwards. Set each textbox's TabIndex property to 0 (zero) as you go. When you run your form the top textbox should have focus and each tab key (or enter as previously mentioned) should then take you to the next textbox in order.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top