Automatic Tabbing Question (1 Viewer)

MrsGorilla

Rat Race Participant
Local time
Yesterday, 19:03
Joined
May 6, 2003
Messages
1,745
Hello all,

A quick search yielded no results, so here goes. What is the easiest way to automatically tab to the next field once a user has entered the maximum number of digits in the current field?

For example, I have a form with the 3-digit area code in one field, followed by the 7-digit phone number (this was set up originally by someone else, I don't know why the area code and phone number are split up). Since these fields will always be the same length, what I'm wanting to do is automatically set focus to the next field once the user has entered 3 numbers in the area code field, without their having to hit the 'Tab' key. Any thoughts?

Thanks in advance...
 

RuralGuy

AWF VIP
Local time
Yesterday, 18:03
Joined
Jul 2, 2005
Messages
13,826
You can check the Len() of the .Text property in the OnChange event and do a Me.YourNextControlName.SetFocus when you have enough characters. You can always put fields back together but separating them can sometimes be difficult.
 

KenHigg

Registered User
Local time
Yesterday, 20:03
Joined
Jun 9, 2004
Messages
13,327
Could you len() in the OnChange event
 

KenHigg

Registered User
Local time
Yesterday, 20:03
Joined
Jun 9, 2004
Messages
13,327
RuralGuy said:
You can check the Len() of the .Text property in the OnChange event and do a Me.YourNextControlName.SetFocus when you have enough characters. You can always put fields back together but separating them can sometimes be difficult.

Yeah, that :p
 

MrsGorilla

Rat Race Participant
Local time
Yesterday, 19:03
Joined
May 6, 2003
Messages
1,745
Thanks, guys. I'm going to give it a whirl to see how it works. :)
 

MrsGorilla

Rat Race Participant
Local time
Yesterday, 19:03
Joined
May 6, 2003
Messages
1,745
Nope. Far too mountainous for our area. Our "mountains" are really more like hills. :(
 

RuralGuy

AWF VIP
Local time
Yesterday, 18:03
Joined
Jul 2, 2005
Messages
13,826
Boy does it ever! I'm stuck looking at this kind of view every day. Oh well, I guess someone has to do it. ;) :D
 
Last edited:

Users who are viewing this thread

Top Bottom