Events on entering subform

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

Guest

Once I have been in the subform, the focus returns to the record & control
that had the focus when leaving the subform. I want to instead set the focus
on the first field of the first record on entering a subform.

With the main form, I would just do this in Form_Open or Form_Activate.
Neither of these fires for the subform when entering it, however, and the
Enter event for the subform, being on the main form, does not allow me to set
the focus to a particular field on the subform.
 
Brian said:
Once I have been in the subform, the focus returns to the record & control
that had the focus when leaving the subform. I want to instead set the focus
on the first field of the first record on entering a subform.

With the main form, I would just do this in Form_Open or Form_Activate.
Neither of these fires for the subform when entering it, however, and the
Enter event for the subform, being on the main form, does not allow me to set
the focus to a particular field on the subform.

Yes it does. Something like this:

Me.SomeSubform.Form.SomeControl.SetFocus
 
Thanks for the syntax. I was trying to do it like I would on the main form:
SubFormName!Control.SetFocus.
 
Back
Top