Tabbing into a subform

  • Thread starter Thread starter Tara
  • Start date Start date
T

Tara

I have a form with several subforms. I would like the
tab to start on the main form and work it's way down into
the subform. The forms are designed to blend seamlessly
so that the user does not even know they are looking at a
subform and getting the tabs to work is part of getting
that effect. Can this be done? If so, how?
Thanks in advance for any help!
 
-----Original Message-----
I have a form with several subforms. I would like the
tab to start on the main form and work it's way down into
the subform. The forms are designed to blend seamlessly
so that the user does not even know they are looking at a
subform and getting the tabs to work is part of getting
that effect. Can this be done? If so, how?
Thanks in advance for any help!

Tara,

all you need to do is set the TabStop property for the
subform as a whole. Let's say on your main form you have a
text box right above your subform that's tab stop 5, then
you'd set teh tab stop for the subform control *on the
main form* to 6.

Then in the subform itself, set the tab stop order however
you need it for all the controls on the subform.

HTH,
 
Thanks for the tip...it worked, but I'm still having an
issue. I can get it to tab into the subform, but then it
continues to cycle through the subform instead of going
to the first text box on the main form. I tried setting
the tab order the way you said to, but no luck. Any ideas
on how to fix this?
 
-----Original Message-----
Thanks for the tip...it worked, but I'm still having an
issue. I can get it to tab into the subform, but then it
continues to cycle through the subform instead of going
to the first text box on the main form. I tried setting
the tab order the way you said to, but no luck. Any ideas
on how to fix this?

Once you get into a subform you need to specifically tell
Access to go back up to the main form, it can't do it
automatically (because now you're in a separate form, not
the original one).

You'll need an _Exit handler for the "last" control in the
subform. When the user moves off of that control the
handler fires. Include the following in that handler:

Me.Parent.Controls("nameofcontroltogobacktohere").SetFocus

That'll move you back up to the main form.

An alternative approach would be to have a "Go Back"
button in the footer of your subform. After the user moves
off the last control they will go to the button (probably
need an _Exit handler for the last control that will
SetFocus on the button, it's been awhile since I've done
this). Then you put the same line of code in the button's
_Click handler.

The first approach is more straightforward to code, but if
for any reason you want the user to have to specifically
click the GoBack button to get out of the subform (maybe
you want them to be able to add another record or
something), then the second approach is better.

HTH,
 
Back
Top