Force cursor into next control

C

CW

I have my Tab Order all working nicely on a form but I would like the cursor
to be moved automatically into a certain field (call it Text2) as soon as a
value has been entered once an earlier one (call it Text1) has been
populated, so that the user doesn't even have to hit the tab button or move
the cursor or anything at all.
I was planning to use the On Change event of Text1 - is that best, and how
would I write this event code please?
Many thanks
CW
 
A

Albert D. Kallal

CW said:
I have my Tab Order all working nicely on a form but I would like the
cursor
to be moved automatically into a certain field (call it Text2) as soon as
a
value has been entered once an earlier one (call it Text1) has been
populated, so that the user doesn't even have to hit the tab button or
move
the cursor or anything at all.
I was planning to use the On Change event of Text1 - is that best, and how
would I write this event code please?
Many thanks
CW

You can actually have this occur automatic. All you need is to set the
underlying field length to what ever you need. so, if you had a field in
which the user was to enter their initials, you make it a length of 2
characters in the tables design.

Then, on the form, set the property (in the "OTHER tab") of Auto tab = yes.

You can also setup a input mask, and again auto tab will jump to the next
text box on the form for you....

So, you have more then one way to do this without any code at all.....
 
J

Jeff Boyce

I'm not quite clear on whether you want this to happen ONLY during data
entry, so that "completing" entry in Text1 will cause the cursor to
automatically advance to Text2, or if you want to be able to open the form
(you ARE using a form, right?) with a record in it and not have to stop at
Text1 if there's already a value in it?

More info, please

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
C

CW

Thanks Albert, interesting, I wasn't aware of AutoTab. Unfortunately it
wouldn't work in this particular control as the entries vary considerably in
length, but I shall certainly be able to use it elsewhere now that I know
about it!
Thanks
CW
 
C

CW

Jeff -
It's the former, i.e. during data entry on a form, that's the only situation
in which it needs to operate. Once the user has finishing entering a value
in Text1 I want the cursor to go straight to Text2.
When the form is just being viewed it's not an issue at all.
Looking forward to your advice
Thanks
CW
 
J

John W. Vinson

Thanks Albert, interesting, I wasn't aware of AutoTab. Unfortunately it
wouldn't work in this particular control as the entries vary considerably in
length, but I shall certainly be able to use it elsewhere now that I know
about it!

If the text is of variable length - HOW can Access detect that the user has
finished, other than by their pressing the Enter or Tab key (which will
automatically go to the next control in any case)??? The telepathic interface
hardware won't be out for a few more years!
 
A

Albert D. Kallal

CW said:
Thanks Albert, interesting, I wasn't aware of AutoTab. Unfortunately it
wouldn't work in this particular control as the entries vary considerably
in
length, but I shall certainly be able to use it elsewhere now that I know
about it!
Thanks
CW

Ok, you say variable length, then you would use my 2nd suggestion and use an
input mask. You not descried how we going to know the person is finished
entering that number (can't read you mind, or theirs!!). However, if it is a
number amount with 2 digits, then you can set the text box as right
justified, and set the input mask like:

!99999999.00

The above means that when the person is finished entering the 2 digits after
the decimal point, the cursor will auto tab to next control.

So, what kind of data entry you talking about? As I said, the above auto-tab
also works with a input mask...
 
H

Howard Burgman

CW said:
I have my Tab Order all working nicely on a form but I would like the
cursor
to be moved automatically into a certain field (call it Text2) as soon as
a
value has been entered once an earlier one (call it Text1) has been
populated, so that the user doesn't even have to hit the tab button or
move
the cursor or anything at all.
I was planning to use the On Change event of Text1 - is that best, and how
would I write this event code please?
Many thanks
CW
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top