Setting Focus on subforms subform

G

Guest

How do you set the focus on a subforms subform?
I have one main form with three subforms:

The mainform is called: Requests
The 1st Subform is called: Subrequests
The 2nd Subform is called: MasterfilesNeeded
The 3rd Subform is called: DataElementsNeeded

I want to set the focus to MasterFilesNeeded
 
W

Wayne Morgan

First, you need to know the name of the subform controls holding each of
these subforms. The subform isn't on the parent form, a control called a
subform control is on the parent form and the subform is contained within
that control.

To set the focus to a control on a subform, it is a two step process. You
first set the focus to the subform control, then to the control on the
subform. So, to set the focus to the second subform from the parent form:

Me.SubformControl.SetFocus
Me.SubformControl.Form.SubformControl2.SetFocus
Me.SubformControl.Form.SubformControl2.Form.txtMyTextbox.SetFocus
 

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