Automatic Advancement To Next Textbox

lhooker

Registered User.
Local time
Today, 18:52
Joined
Dec 30, 2005
Messages
423
What is needed to move to the next textbox automatically without tabbing ?

Current settings are as follows for all textboxes.

Tab Index is 12
Tab Index is 13
Tab Index is 14
Tab Index is 15
Tab Index is 16
Tab Index is 17
Tab Index is 18
Tab Index is 19
Tab Index is 20

Tab Stop Yes
Auto Tab is Yes
Vertical is No
 
Enter key should do that unless you change the control's EnterKeyBehavior property. Also, Options>Client Settings>Move After Enter sets the default action for Enter key.
 
I want to automatically advance to the next textbox after entering a numeric value.
 
Last edited:
Nonsense. Obviously, ACCESS has no way of knowing you have entered the entire number unless you hit the Enter or Tab key.
You would need to check you have the correct number of characters before setting focus to the next control?
 
You would need to check you have the correct number of characters before setting focus to the next control?
Yes. The key word is "You". ACCESS has no way of knowing does it?
 
It should be possible to write code on the control's Change event to count the number of characters entered and advance to the next control when the required number of characters have been entered. The key, of course, is in having one required number of characters--no more and no less. If the number of characters entered varies, this is an extremely tough nut to crack.
 
Well I'll be damned. It turns out I don't know everything there is to know in the universe after all. You can, in fact, count the number of characters in a text box using the On Change event. I have a text box named SearchLibrary, so I can count the characters after every character entry by using:
Len(Me.SearchLibrary.Text)
in the SearchLibrary On Change event.
So then you can go to another control name if Len(Me.TextBoxName.Text) reaches your desired maximum text lengh.
It's still going to be complicated for the OP with several controls involved, but it is possible.
 
What exactly is the rationale for not using the enter key?

Does each textbox require the same number of characters?
I agree with GPG, it seems a lot of work.
You could have a function to compare the number of characters entered vs the number of characters required. But it really depends of the business requirement.
 
What exactly is the rationale for not using the enter key?

Does each textbox require the same number of characters?
I agree with GPG, it seems a lot of work.
You could have a function to compare the number of characters entered vs the number of characters required. But it really depends of the business requirement.
Each individual textbox is going to have to be coded in its On Change event according to each character requirement and then tested for that requirement and then if the requirement is met moving to the next control. That means if the character number requirement is 4 and the number input is 6, the OP is going to have to format the textbox to accept 3 leading zeros before the number 6. I thinks it's nuts but it's not my app.
 
Thanks for the update LarryE, but I wanted the OP (lhooker) to describe the business rationale for this.
Are you guessing the requirement or do you know that is what is required?
I tend to agree with your "I thinks it's nuts but it's not my app.", but the OP hasn't provided info as to "why" this is needed. There may be many ways to effect the desired outcome, but counting characters based on On Change would seem to be far down the list.
 
Thanks for the update LarryE, but I wanted the OP (lhooker) to describe the business rationale for this.
Are you guessing the requirement or do you know that is what is required?
I tend to agree with your "I thinks it's nuts but it's not my app.", but the OP hasn't provided info as to "why" this is needed. There may be many ways to effect the desired outcome, but counting characters based on On Change would seem to be far down the list.
Yes I understand that. The requirement I am taking about is the character requirement for each textbox. The OP didn't say. The example I gave was just an example. If the text box character requirement number is 4 characters before moving to the next control, then the textbox needs to be tested for 4 characters. If the number 6 is the number the user wants in the textbox, then 0006 needs to be entered.
 
If a specific number of characters (or digits) is required, why bother with complex VBA in Change event? - use input mask as suggested in post 4.

If variable length input is permitted, I do not see a solution.
 
What exactly is the rationale for not using the enter key?
The enter key should be used to move to a new record, just as the "return/enter" key on the typewriter we used for over 150 years was used to move to a new line. This is muscle memory at work. Don't change something that doesn't need changing.

The logical way to move from control to control is to use the Tab key rather than changing the default key functionality to make them work illogically.

I agree with @June7 's #13 response.
 

Users who are viewing this thread

Back
Top Bottom