Tabbing from sub-form to sub-form

  • Thread starter Thread starter FG
  • Start date Start date
F

FG

I have a form with 2 subforms. When I complete a record in
the first subform I want it to go to the next subform but
instead it goes to a new record in the first subform. I
changed form one to cycle on current record just to check
but that helps nothing. My main form does have both forms
listed in the tab order view. Thanks in advance for the
help.
 
FG said:
I have a form with 2 subforms. When I complete a record in
the first subform I want it to go to the next subform but
instead it goes to a new record in the first subform. I
changed form one to cycle on current record just to check
but that helps nothing. My main form does have both forms
listed in the tab order view. Thanks in advance for the
help.

You can use Ctrl-Tab to tab out of the first subform on to the next control
on the main form (i.e. the second subform).

Although you could use code to set the focus, it could get annoying if you
want to enter more than one record in the first subform.
 
-----Original Message-----
You can use Ctrl-Tab to tab out of the first subform on to the next control
on the main form (i.e. the second subform).

Although you could use code to set the focus, it could get annoying if you
want to enter more than one record in the first subform.
I wouldn't want more than 1 record at a time entered in
the first subform at a time so code to set focus shouldn't
be a problem. Can you give me an example? thanks much!
 
FG said:
I wouldn't want more than 1 record at a time entered in
the first subform at a time so code to set focus shouldn't
be a problem. Can you give me an example? thanks much!

You can add a textbox (very narrow almost invisible), as the last control in
the tab order of the first subform. In it's Enter event set focus to the
second subform, and then to the first control on it.

Me.Parent!SecondSubformControl.SetFocus
Me.Parent!SecondSubformControl.Form!FirstControl.SetFocus

If you are just going to enter one record in the first subform, why not make
it a single form with the 2nd subform nested inside it?
 
-----Original Message-----


You can add a textbox (very narrow almost invisible), as the last control in
the tab order of the first subform. In it's Enter event set focus to the
second subform, and then to the first control on it.

Me.Parent!SecondSubformControl.SetFocus
Me.Parent!SecondSubformControl.Form!FirstControl.SetFocus

If you are just going to enter one record in the first subform, why not make
it a single form with the 2nd subform nested inside it?
The first subform is a continuous form displaying several
records, the second subform displays details from the
corresponding record in the first subform. I want people
to complete the first subform then enter details in the
second. I tried your code and it does take me to the
second subform but then I'm stuck there. I can't click
back up in the first subform. What am I missing?
 
FG said:
The first subform is a continuous form displaying several
records, the second subform displays details from the
corresponding record in the first subform. I want people
to complete the first subform then enter details in the
second. I tried your code and it does take me to the
second subform but then I'm stuck there. I can't click
back up in the first subform. What am I missing?

I can't reproduce. Are you clicking in the first control of the first
subform, when you want to go back?
 
I think I tried clicking on all controls
-----Original Message-----


I can't reproduce. Are you clicking in the first control of the first
subform, when you want to go back?

--
Joan Wild
Microsoft Access MVP


.
 
There must be something else causing this. It doesn't happen here - I have
no problem clicking anywhere in the first subform.

Check the code behind both the subforms to see if there's something there.

What happens when you 'can't click'. Do you get an error? Where does the
focus return to?
 
Back
Top