Make the cursor jump to the field I want after i press a bottom

L

Luis P.

Pls help me find out the way to make the cursor jump from a sub-form to other
sub-form in the same form.
 
O

Ofer Cohen

On the LostFocus event of the last field in the first sub form, run the code
that et the focus to the field in the second sub form

Me.Parent.[SecondSubFormControlName].Form.[TextBoxName].SetFocus
 
J

John W. Vinson

Pls help me find out the way to make the cursor jump from a sub-form to other
sub-form in the same form.

A couple of ways. Ctrl-Tab will tab out of the subform to the next control in
the mainform's tab order; you could make this the next subform. If you want to
jump automatically after you fill in the last control in the first subform's
tab order, you can put an additional textbox on the subform; hide it behind
some other control, and in its GotFocus event put

Private Sub txtRelay_GotFocus()
Parent.SetFocus
Parent!secondsubformname.SetFocus
Parent!secondsubformname.Form!controlname.SetFocus
End Sub

to set the focus to a specific control in the second subform.

John W. Vinson [MVP]
 
Top