a different question about focus

  • Thread starter Thread starter 2Stupid2ownAputer
  • Start date Start date
2

2Stupid2ownAputer

Hello I hope some kind person can help me.
I have a "date of death" field followed
by an "age of death" field
and then a relationship field on my form.
because I'm using speech to text software, I enter text by entering the
"date of death" then "press" (by voice) the tab key, I enter the "age of
death" then press the tab key and enter "relationship".
because I'm using voice to text I find it easier to say the date of death
and age of death in one phrase
so I added an unbound text box to input both and then on pressing the tab
key it updates both fields and clears the unbound text box. It works fine
However the focus remains at the date of death text box.
I want it to skip a field so that it moves to the relationship field.
I thought some thing like in before update on the unbound field
-- relationship.got focus --
but I get an error -- relationship cannot contain a null value (relationship
is not a required field)
Any Ideas?
Thanks in advance and a happy Christmas to you all
Regards
 
First, if you also have everyone's birthday, I wouldn't enter the age at
death, I would just calculate it based on the birth date and death date.

Next, you can set the Tab Index (order) on the controls in form design view.
The Tab Index is on the Other tab of the control's Properties dialog. The
tab order will follow the Tab Index numbers sequentially unless you do
something to change it, such as click into another control or use code to
set the focus to a control. You can also set the Tab Stop property to tell
Access not to tab to that control, but you can still go to it by the other
ways mentioned above. If Tab Stop is No, the control will still have a Tab
Index number so that Access will know which control to go to next when you
tab out of the control. When you change the Tab Index number, Access will
automatically place that control in the tab order after the one with the
next lower number and roll the numbers (as necessary) of all controls that
have Tab Index numbers equal to or greater than the one you just entered to
sequence them after the control you just entered the number for.

There is also an option for an Auto Tab. If you limit a control to a certain
number of characters, Access will automatically tab to the next control once
that number of characters has been entered. However, the control must have
the focus as you enter the characters for this to work. Also, an age may
have 1, 2, or 3 digits, so this would be hard to set up unless you entered
leading zeros.

You could use code to move the focus to another control when this control
gets the focus and already has a value. The problem with this is it would
keep you from editing the control, so you would probably only want to do it
for a new record and you would have to save that record before you could
correct the age if you made a mistake entering it.

Example GotFocus event for control:
If Not IsNull(Me.NameOfControl) And Me.NewRecord Then
Me.NameOfNextControl.SetFocus
End If
 
Hi Wayne,
Thanks for your reply.
In most cases I don't have date of death
I tried to alter the tab index but for some reason it wouldn't work (I'm
viewing in datasheet mode).
However your suggestion about changing the tab stop to no
works just fine, if I need to go back I can just click.
The code option wouldn't work for me in this instance because of the reasons
you suggested.
Problem solved
Thanks very much
Regards and have happy Christmas
 
Back
Top