Tabbing between subforms and main form

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.
 
W

Wayne Morgan

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.
 

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