arnelgp
..forever waiting... waiting for jellybean!
- Local time
- Today, 10:25
- Joined
- May 7, 2009
- Messages
- 20,275
hello to all!
does Navigation Form gives you a headache. when your standalone form is working properly and you can refer to any control with ease. then when you moved it inside the Navigation Form all your control references are now invalid.
forms![Navigation Form]!mySubform1!TargetSubform.Form.yourControl
the above codel not work!?
hope is not lost at all and there is an easy way to go around this problem.
you see Forms and Reports are all Classes. a class can have many functions, procedures and properties (public and privates).
say on the above example (TargetSubform), you want to expose the value of your textbox( ie, txtTextName) and you want it to be accessible to any other subform inside the Navigation Form, including the Navigation form.
all you have to do is open the TargetSubform in form design and create a Public Function or Get Property in TargetSubform:
Public Property Get GET_TextName() As Variant
GET_TextName = Me.txtTextName
End Property
or
Public Function GET_TextName() As Variant
GET_TextName = Me.txtTextName
End Function
save the form and your done.
now go to the VBE and notice your TargetSubform class there, the one preceeded with "Form_".
to retrieved the value of your txtTextName control on TargetSubform in any subform within Navigation Form:
yourTargetControl = Form_TargetSubform.GET_TextName()
or
MsgBox "" & Form_TargetSubform.GET_TextName()
now its time for you to try it on your dreaded Navigation Form.
happy coding to all
does Navigation Form gives you a headache. when your standalone form is working properly and you can refer to any control with ease. then when you moved it inside the Navigation Form all your control references are now invalid.

forms![Navigation Form]!mySubform1!TargetSubform.Form.yourControl
the above codel not work!?
hope is not lost at all and there is an easy way to go around this problem.
you see Forms and Reports are all Classes. a class can have many functions, procedures and properties (public and privates).
say on the above example (TargetSubform), you want to expose the value of your textbox( ie, txtTextName) and you want it to be accessible to any other subform inside the Navigation Form, including the Navigation form.
all you have to do is open the TargetSubform in form design and create a Public Function or Get Property in TargetSubform:
Public Property Get GET_TextName() As Variant
GET_TextName = Me.txtTextName
End Property
or
Public Function GET_TextName() As Variant
GET_TextName = Me.txtTextName
End Function
save the form and your done.
now go to the VBE and notice your TargetSubform class there, the one preceeded with "Form_".
to retrieved the value of your txtTextName control on TargetSubform in any subform within Navigation Form:
yourTargetControl = Form_TargetSubform.GET_TextName()
or
MsgBox "" & Form_TargetSubform.GET_TextName()
now its time for you to try it on your dreaded Navigation Form.
happy coding to all
