Tabbing between subforms and main form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have one main form with two subforms. The focus starts in subform 1, you
tab through the subform to the main form, tab through the main form to the
second subform, through that to a command button, and back to the first
subform. I'm using tabnabbers, but when I tab from my command button to my
first subform, I get a run-time error 2110. Any help in solving this would
be appreciated.

Thank you.
 
When using code to tab into a subform, it is a two line process. You first
have to set the focus to the subform control on the parent, then to the
control on the subform.

Example:
(assuming the code is running from the 2nd subform)
Me.Parent.FirstSubformControl.SetFocus
Me.Parent.FirstSubformControl.Form.ControlOnFirstSubform.SetFocus

As you can see by this, going from the subform to the parent only requires
one line (the first one in this case), but going from the Parent to the
subform requires the two step process.
 
Back
Top