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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

'Auto tab' from fields

Status
Not open for further replies.

traffas

Programmer
Feb 27, 2002
42
0
0
US
The situation:
I have several fields that I would like to autotab out of following a certain number of keystrokes. example: time field (short time) in the form of 12:12. the mask places the colon. After 4 key strokes I would like to tab to next field. The next field is a numerical field but can only have 3 digits in it. After entering 3 digits, I would like to auto tab to next field.

A friend (who was looking at my program) asked if this was possible. I saw a FAQ on how to auto tab out of a text field, but I haven't been able to figure out the code to do it with a numerical field or a time field.

many thanks in advance

Shawn
 
Hi there

on the KeyUp or the KeyPress events of each text box, you need to check the length of the text it contains. Although isn't 12:12 actually five keystrokes??

Anyways in the KeyUp event for example you would have something like

If len(textfield.text) = 5 then
nextfield.setfocus
end if

And so on and so forth :)

Hope this helps

Transcend
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top