subform to subform

  • Thread starter Thread starter JohnE
  • Start date Start date
J

JohnE

I have a main form with 2 subforms on it. I would like to tab from one
subform to the next. I'm trying to use the OnExit of the last control in
subformA and set focus of the first control in subformB but it just isnt'
working.

I need help on the correct way to reference it all.

Thanks.
 
John,

I don't know what you have tried yet but it could look something like this:

private sub controlname On_Exit

forms!mainformname!subformnameB.form.controlname.setfocus

replace the form and controlnames accordingly.
hth
end sub
 
hmmm,

sorry about the answer John, that isn't going to work. I'll take a closer
look at it.
 
try

Me.Parent!SubformB.SetFocus
Me.Parent!SubformB.Form!ControlName.SetFocus

replace ControlName with the correct name of the control in subformB, of
course. and make sure that you're using the correct name to refer to
subformB. to find it, open the mainform in Design view. within the mainform,
click *once* on subformB to select it. in the Properties box, click the
Other tab and look at the Name property. *that name* is the name you'll use
in the code above, in place of SubformB.

hth
 
Back
Top