How to update a field in a subform?

wcoast

Registered User.
Local time
Today, 12:14
Joined
Jul 9, 2006
Messages
27
Hi!
I have Form1 with two subforms in. They are both on subform1 level (not nested).

From one of the subforms i can ask the parentform for a value in a textbox on parentform: Me.Parent!Controlname.Value

But:

How can i succeed updating a subforms textbox (called "textbox1"), when being on main (parent) form?

I have tried with this syntax: Me!Subform1.Form.textbox1.Value = "test"
Neither does: Me!Subform2.Form.textbox1.Value = "test" work..

Thanks for your help ;) I've spent hours with this one..
 
ejstefl said:

Thanks! Yeah, i needed to know the name of the subformcontrol that the subform is embedded in. Now it works ;)

For those who are interested:
I made an testapp. It had 2 forms: frmMain & frmSub
The subformcontrol on frmMain I named 'frmSubControl'.
frmSub had a textbox named 'txtSub'.
This codesnippet did the work:

Me!frmSubControl.Form!txtSub = Me.txtMain

:)
 

Users who are viewing this thread

Back
Top Bottom