Setting Focus on subforms subform

  • Thread starter Thread starter Guest
  • Start date Start date
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
 
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
 
Back
Top