navigating through sub forms

M

Mark G

I have a form that has three sub forms on it. On the second subform it is
set to allow several records to be entered continously when tab or enter is
pressed. After you tab out of the last field it goes to the first field in
the record. What I would like to do is if this first field does not have any
data entered and tab or enter is pressed that it will take the user to the
next subform. Thanks for any help.
 
K

kingston via AccessMonster.com

Create a public subroutine in the main form:

Public GoToSub3 ()
DoCmd.GoToControl Me.SubForm3.Name
End Sub

Create a subroutine for the OnExit event of the last field in the second
subform. In the subroutine, check for IsNull([FirstField]). If it is true,
then call the public subroutine of the main form that transfers the focus to
subform 3:

Forms!MainForm.GoToSub3
 
M

Mark G

Thanks Kingston. That is what I was looking for.

kingston via AccessMonster.com said:
Create a public subroutine in the main form:

Public GoToSub3 ()
DoCmd.GoToControl Me.SubForm3.Name
End Sub

Create a subroutine for the OnExit event of the last field in the second
subform. In the subroutine, check for IsNull([FirstField]). If it is true,
then call the public subroutine of the main form that transfers the focus to
subform 3:

Forms!MainForm.GoToSub3

Mark said:
I have a form that has three sub forms on it. On the second subform it is
set to allow several records to be entered continously when tab or enter is
pressed. After you tab out of the last field it goes to the first field in
the record. What I would like to do is if this first field does not have any
data entered and tab or enter is pressed that it will take the user to the
next subform. Thanks for any help.
 
Top