setting focus - sub form

  • Thread starter Thread starter Alex H
  • Start date Start date
A

Alex H

Hi, if I have focus in subform 1, and I want to programme to filla field in
subform2 on the sameparent, can someone tell me what the coorrect syntax is
to get focus on the second form.

i have tried : Me.parent.subform2name,but that doesnt seem to work

tks

Alex
 
Alex H said:
Hi, if I have focus in subform 1, and I want to programme to filla
field in subform2 on the sameparent, can someone tell me what the
coorrect syntax is to get focus on the second form.

i have tried : Me.parent.subform2name,but that doesnt seem to work

You shouldn't have to set the focus to that control in order to set its
value. Have you tried

Me.Parent!subform2name!ControlName = <some value>

? Note that "subform2name" must be the name of the subform *control* on
the main form, which is not necessarily the same as the name of the form
being displayed by that control. Of course, you should substitute the
name of the control on the subform for "ControlName" in the above.

If you do need to set the focus to the control on the other subform, you
probably need to use SetFocus twice: once for the main form and once
for the subform. Try this:

Me.Parent!subform2name.SetFocus
Me.Parent!subform2name.Form!ControlName.SetFocus
 
Back
Top