You shouldn't need to set the focus to the parent (main) form first, just to
the 2nd subform then the control on the 2nd subform. Also, you need to use
the name of the control that holds the subform, not the name of the subform,
although it may turn out that they are both the same. To get the name of
this control, open the main form in design mode, open the Properties sheet,
click on the subform ONE time. The Properties sheet will show the name of
the subform control. If you click on the subform a second time, you'll be in
the subform and the Properties sheet will show the name of the form, not the
name of the control holding the form.
--
Wayne Morgan
Microsoft Access MVP
Gulf Coast Electric said:
I dont understand, this doe not work of course.
Main form is DepositSlips, sub form is Depositor and other sub is depositsub
Need to go from sub form Depositor to sub form depositsub amd then go to
control deposit.
Me.Parent.DepositSlips.Form.SetFocus
Me.Parent.Depositor.Form.SetFocus
Me.Parent.depositsub.Form.Deposit.SetFocus
--
-------------------------------------------------------------------------
Thanks for your Help.
To refer to a subform from a main form you need to refer to the name
of
the
control on the main form that holds the subform, not the name of the
subform. To go from one subform to the other, go up to the main form then
down to the subform. To set the focus to a control, you need to set the
focus to the subform, then to the control.
Me.Parent.subform2.Form.SetFocus
Me.Parent.subform2.Form.Deposit.SetFocus
--
Wayne Morgan
Microsoft Access MVP
I have a form named DepositSlips and on it I have (2) sub-forms.
I need to after pressing the tab button on the sub-form named Depositor
(Control (Customers)
go to another sub-form named depositsub and go to control (deposit)
I tried this code, but it didnt work.
If KeyCode = Asc(vbTab) Then
Forms!depositsub![Deposit].SetFocus
KeyCode = 0
End If
-------------------------------------------------------------------------