pupulate control from subform2 to subform1

  • Thread starter Thread starter Silvio
  • Start date Start date
S

Silvio

II have a main form with 2 subforms

MainForm
Subform1
Subform2

I am trying to populate Mycontrol1 in subform1 from a mycontrol2 from subform2
(e.g. Me.Mycontrol1 = Me!subform2.Form!mycontrol2)
Acces keeps telling me that can not find the subform2

I am getting VERY frustrated, what' the correct syntax?


Thank you,
Silvio
 
If I'm understanding correctly, Subform1 and Subform2 are both subforms of
MainForm. That means you need to navigate to Subform2 from MainForm, not
from Subform1 (which is what Me on Subform1 would refer to)

Try either

Me.Mycontrol1 = Me.Parent!Subform2.Form!mycontrol2

or

Me.Mycontrol1 = Forms!MainForm!Subform2.Form!mycontrol2

Note that this assumese that the name of the subform control on MainForm is
actually subform2. Depending on how you added Subform2 as a subform on
MainForm, the name of the subform control may be different than the name of
the form being used as a subform.
 
Back
Top