Auto-move to next field when required # chars entered

WinDancer

Registered User.
Local time
Yesterday, 19:15
Joined
Oct 29, 2004
Messages
290
I have a field on a form that requires exactly 8 chars- when the user has entered all 8 i want to auto tab to the next field... haven't used this for several years and can't even find a reference to it :)
TIA
Dave
 
In the control's On Change event, place:

If Len(Me.YourControlNameHere) = 8 Then Me.YourNextControlName.SetFocus
 
Thanks, Bob. Not the way I remember doing it but this should work just fine :)
 
Ooops... spoke too soon- it is requiring me to hit tab or enter to 'finish' updating the field.
Any other suggestions?
TIA
Dave
 
I don't know why that would be since if you put it in the On Change event of the text box it should, when the length is 8 characters, move along.
 
That is how I set it up- but nothing happens after the 8 chars are entered....
 
Never mind - I just figured it out. You need:

If Len(Me.YourControlNameHere.Text) = 8 Then Me.YourNextControlName.SetFocus
 
Simple Software Solutions

Ok

There is a built in function you can use:

Go to the properties of the said textbox and enter an imput mask to match the 8 characters.

Next scroll down set the AutoTab property to True.

As soon as you complete the last character in the string it automatically progresses to the next control in the tab index.

CodeMaster::cool:
 
Ok

There is a built in function you can use:

Go to the properties of the said textbox and enter an imput mask to match the 8 characters.

Next scroll down set the AutoTab property to True.

As soon as you complete the last character in the string it automatically progresses to the next control in the tab index.

CodeMaster::cool:

Oooh - something new that I didn't know - great stuff - thanks!
 
Thanks to all-
DCrake that is what i used to use- thanks!

Dave
 
Simple Software Solutions

You surprise me Bob, a man of your considerable knowledge not knowing about the autotab property. This has been around since A97. Another couple of tricks I picked up also are:

Press Ctrl+' in a datasheet copies the data from the above record to the field below. Similar to how F8 used to work.

Press Ctrl+: to input today's date into a field, be it on a form or a datasheet.

David
 
Auto Tab

Set the Input Mask property to enter 8 character say something like one below:

>CCCCCCCC;;_

to enter 8 characters and all of them change to uppercase. Set the Auto Tab property to Yes

You can search on Input Mask in Access Help for different Mask Characters and their meanings.

Regards

http://www.msaccesstips.com
 
You surprise me Bob, a man of your considerable knowledge not knowing about the autotab property. This has been around since A97.
And, sometimes you just don't find out about some things until way later :) It is funny but I never heard about that one and never found it myself. So, as I've always said, I learn things all the time on the forums, even with many years of experience. :cool:
 
I knew about it but never use it because you have to those evil Input Masks! And after you do that, of course, you have to put in code so that if the user clicks on the textbox, but not at the beginning of the box, the cursor will move to the beginning. Otherwise, the user starts typing and the input mask isn't satisfied and you get an error. Then something designed to facilitate data entry slows it down instead! Seems like a lot of work to avoid writing an OnChange event with one line of code! Which is why I always use the same approach Bob gave.
 
Simple Software Solutions

Bob,

I have beenusing Access since version 4.3 (Access 2) all self taught. At present I have a copy 2007 on my personal laptop but I have not tried anything substantial with yet. Due to the number of threads I read on the problems people are encountering. But I expect a SP will be released soon. In respect to learning, yes I agree, the only way to find things out is to experiment, if that fails then RTFM or STFW, then when all else fails Ask for help. What realy annoyed me about Access is when the migrated from A97 they took out the formatted message box whereby you could have the first section of the message in bold using the @ keys. I know there is a function available to replace the existing MsgBox but it is a bug bear changing it all and it does not work so well in VB6.0

Any shortcuts are always good to come across now and again and, as you expressed; you never stop learning.

David
 
Simple Software Solutions

Ok

So from a developers point of view what would be the carrot for me to upgrade to 2007? And how easy is it to migrate previous versions. What is the best thing you have come across having upgraded?

David
 
I haven't had many issues with running previous version dbs on A2K7, but as for in real production we only have one db right now in A2K7. I don't know that there's a whole lot of incentive as far as upgrading goes right now. There are a few new features, including integrated data collection via Outlook, that are cool but most of the new features are actually geared around the novice and not the professional developer.

But, I do like it and I, unlike several others, do like the new ribbon (although I wish they would give you more options around the actual display of it).

I actually use 2003 and 2007 back and forth and so I really don't consider myself as having "upgraded" at this point.
 

Users who are viewing this thread

Back
Top Bottom