How to restart tab index on subform after moving to next record?

C

cybersafe

I have added three subforms to a main form and set tab indexes for several
fields on each subform. The first time tab through the forms, the cursor
tabs correctly through the mainform and subform fields. When I create anew
recordonthe mainform, the subforms show blank entriews as they should, but
when I tab to them, the cursor goes to the last indexed field on each subform
rather than the first as it shoiuld have (and did) on the previous tab run.
Why is this and how can I fix it?
 
W

Wolfgang Kais

Hello "cybersafe".

cybersafe" said:
I have added three subforms to a main form and set tab indexes
for several fields on each subform. The first time tab through the
forms, the cursor tabs correctly through the mainform and subform
fields. When I create a new record on the mainform, the subforms
show blank entriews as they should, but when I tab to them, the
cursor goes to the last indexed field on each subform rather than
the first as it should have (and did) on the previous tab run.
Why is this and how can I fix it?

When leaving a subform, the active control of the subform still does
not change. You could try to use the Enter event of the subform
control to set the focus to the first control in the subform:

Me!Subformcontrol.Form!FirstControlName.SetFocus
 
C

cybersafe

Wolfgang Kais said:
Hello "cybersafe".



When leaving a subform, the active control of the subform still does
not change. You could try to use the Enter event of the subform
control to set the focus to the first control in the subform:

Me!Subformcontrol.Form!FirstControlName.SetFocus
Wolfgang
Thank you for solving my proble. Your explanation cleared up my
misconception about the subform -- the setfocus method works and seems to be
the best way to reinitialize the tab functionality.
Bob (cybersafe)
 

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