Form-Subform Tabs

  • Thread starter Thread starter DaveB
  • Start date Start date
D

DaveB

I have a main form with two subforms. I can tab through
the main form onto the first subform. At the last field of
the first subform, it goes to the top of that subform and
starts again with the next record.

I want the tab to just go through the main form onto the
fist subform right into the third subform.

Please advise how to accomplish this and thanks.

DaveB
 
The built-in way of doing this is to use Ctl-Tab.

If that doesn't work for you then you can use a little coding trick -
basically all you do for this is create a tiny .001 x .001 textbox and put
it as the last control in the tab order of the subform. The control should
have its visible property set to true so that it can receive the focus.
Since it is so tiny it won't be seen. Then in the Gotfocus event of this
control you can setfocus back to a control on the main form or to another
subform.

Regardless of which method you use, use the Tab Order on the main form to
sequence the subform controls correctly.
 
Is the control on the "on got focus" an:

Expression Builder
Macro Builder or
Code Builder...

and can you help me with the code. thanks!

DaveB
-----Original Message-----
The built-in way of doing this is to use Ctl-Tab.

If that doesn't work for you then you can use a little coding trick -
basically all you do for this is create a tiny .001 x .001 textbox and put
it as the last control in the tab order of the subform. The control should
have its visible property set to true so that it can receive the focus.
Since it is so tiny it won't be seen. Then in the Gotfocus event of this
control you can setfocus back to a control on the main form or to another
subform.

Regardless of which method you use, use the Tab Order on the main form to
sequence the subform controls correctly.

--
Sandra Daigle [Microsoft Access MVP]
Please post all replies to the newsgroup.

I have a main form with two subforms. I can tab through
the main form onto the first subform. At the last field of
the first subform, it goes to the top of that subform and
starts again with the next record.

I want the tab to just go through the main form onto the
fist subform right into the third subform.

Please advise how to accomplish this and thanks.

DaveB


.
 
Use the code builder (...)

Private Sub Text3_GotFocus()
Me.Parent.sfrm2.SetFocus
Me.Parent.sfrm2.Form.Custid.SetFocus
End Sub

The above will set focus to the subform control named 'sfrm2' on the
mainform and then to the control named 'Custid' on the subform. (To set
focus to a control on subform you must first setfocus to the subform
control).
--
Sandra Daigle
[Microsoft Access MVP]
For the benefit of others please post all replies to this newsgroup.
Is the control on the "on got focus" an:

Expression Builder
Macro Builder or
Code Builder...

and can you help me with the code. thanks!

DaveB
-----Original Message-----
The built-in way of doing this is to use Ctl-Tab.

If that doesn't work for you then you can use a little coding trick -
basically all you do for this is create a tiny .001 x .001 textbox and put
it as the last control in the tab order of the subform. The control
should have its visible property set to true so that it can receive the
focus. Since it is so tiny it won't be seen. Then in the Gotfocus event of this
control you can setfocus back to a control on the main form or to another
subform.

Regardless of which method you use, use the Tab Order on the main form to
sequence the subform controls correctly.

--
Sandra Daigle [Microsoft Access MVP]
Please post all replies to the newsgroup.

I have a main form with two subforms. I can tab through
the main form onto the first subform. At the last field of
the first subform, it goes to the top of that subform and
starts again with the next record.

I want the tab to just go through the main form onto the
fist subform right into the third subform.

Please advise how to accomplish this and thanks.

DaveB


.
 
Back
Top