setfocus on form control, not subform

  • Thread starter Thread starter CuriousMark
  • Start date Start date
C

CuriousMark

I have a form with a subform. After entering data in the subform the user
selects the next record or new record navigation button. The focus for the
new form stays on the subform, and does not move to the first tab order field
in the main form. I have tried various event procedures, including
Form_Update, Form_Activate, Form_Load, and Form_Open, but I can't get the
focus to move to the first field in the main form.
 
CuriousMark said:
I have a form with a subform. After entering data in the subform the user
selects the next record or new record navigation button. The focus for the
new form stays on the subform, and does not move to the first tab order
field
in the main form. I have tried various event procedures, including
Form_Update, Form_Activate, Form_Load, and Form_Open, but I can't get the
focus to move to the first field in the main form.


The Current event is the one you would want to use. Something like:

Private Sub Form_Current()

Me.YourPreferredControl.SetFocus

End Sub
 
I have a form with a subform. After entering data in the subform the user
selects the next record or new record navigation button. The focus for the
new form stays on the subform, and does not move to the first tab order field
in the main form. I have tried various event procedures, including
Form_Update, Form_Activate, Form_Load, and Form_Open, but I can't get the
focus to move to the first field in the main form.

I've fairly often seen it necessary to do TWO setfocus actions: first to the
desired form, then to the control on that form.
 
Thanks. That worked. But I also modified the event processing module from the
Wedding database in the Viescas' Access 2003 so that I could view the events
for the form/subform combination. Form_Current() was the one that did it.
 
Back
Top