SteveL13
asked on
How tab to 1st field on next sub-form
I have a main form with 2 datasheet sub-forms. On the 1st sub-form, if the user leaves the first field in a new record empty, when they tab off of it I want the cursor to go to the 2nd sub-forms 1st field.
I have tried these and they don't work:
I have tried these and they don't work:
Private Sub cbo1stForm1stCombobox_LostFocus()
If IsNull(Me.cbo1stForm1stCombobox) Then
' Forms!frmMainForm!frm2ndSubForm.Form!cbo1stField.SetFocus
' Me.Parent.Form!frm1stSubForm.Form.cbo1stField.SetFocus
' Me.Parent!frm2ndSubForm.Form.cbo1stField.SetFocus
' Forms!frm2ndSubForm.Form.cbo1stField.SetFocus
End If
End Sub
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Seems I do have to set focus on the 2nd sub-form first. Thanks.
Me.Parent.SecondSubformCON
Be careful with the name of the Subform CONTROL. It's the name of the Control on your parent form, and may or may not be named the same as the form that you're using as a Subform.