Back tab between subforms?

P

Pamela

Some of my users are naturally using a back tab (Shift + Tab) to back up to a
previous control where they may have made a mistake or tabbed to quickly over
but in this case, the previous control is on a different subform. The back
tab doesn't work - it only ends up tabbing to the next subform. Can I make a
fix for this to be more user friendly for them?

Thanks!

Pamela
 
J

John W. Vinson

Some of my users are naturally using a back tab (Shift + Tab) to back up to a
previous control where they may have made a mistake or tabbed to quickly over
but in this case, the previous control is on a different subform. The back
tab doesn't work - it only ends up tabbing to the next subform. Can I make a
fix for this to be more user friendly for them?

Thanks!

Pamela

One way would be to put two textboxes on the form, first and last in the tab
order. They must be enabled and have their Visible property set to true, but
they can be one twip square and/or transparent and/or hidden behind another
control.

In the textbox's GotFocus event you can set focus to the previous (or next)
subform.
 
P

Pamela

Thanks for that idea. I had thought of that but then was afraid that I'd
create a loop because I have the same thing happening for the regular tab but
then I realized that I have the power to set the focus to anything I want!
LOL So now in doing, I have an unbound text box on my form with the
OnGotFocus event set to:
Me!sfrmInspection.Form!DateInspected.SetFocus
But when I tab into this field, it doesn't automatically move the focus
until tab is pressed again. Most of them make the step invisible to the user
- what I am missing that it's stopping on this text box.
And yes, this is directing from my MainForm to Subform1 since I now have a
first unbound text box on my subform at which I don't want the automatic tab
to stop.

Thanks again for all of your help on this!!

Pamela
 
J

John W. Vinson

OnGotFocus event set to:
Me!sfrmInspection.Form!DateInspected.SetFocus

ah... forgot to mention a little quirk!

To set the focus to a control on another subform you must do TWO SetFocus
steps - once to the form, once to the control. And since you're executing the
code from a subform, you must use Parent! rather than Me! (if sfrmInspection
is indeed on the mainform, not on your current subform).

Try

Parent!sfrmInspection.SetFocus
Parent!sfrmInspection.Form!DateInspectes.SetFocus
 
P

Pamela

I set it up to work on the OnExit event of the previous control which seems
to be working fine. Thanks though!
 

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