Why linkchildfields code not work

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

My code From Cmdclick event is

Me.Plan.LinkMasterfields
Me!Plansub.form.Plan.LinkChildfields

Where Plan is control name on Main and Subform (Yes/No type)
when I click cmd button, It shows error message method not found
Where am I wrong
 
My code From Cmdclick event is

Me.Plan.LinkMasterfields
Me!Plansub.form.Plan.LinkChildfields

Where Plan is control name on Main and Subform (Yes/No type)
when I click cmd button, It shows error message method not found
Where am I wrong

The Link Master field an Link Child Field are *properties* of a
Subform object. They aren't "methods" - they don't *do* anything.

They are available in code if you wish to change their values; for
example

Me.Plan.LinkMasterFields = "ID;PlanDate"

would set the Master Link Fields property of the subform control to
those values.

What are you trying to accomplish with this code?

John W. Vinson[MVP]
 
Thankyou for your answer but it still not work.

I already have links masterfield and childfields (YearBudg,MaintID: Same
control name in main and subform) by setting in design form and in some case
I want to add new link for other control in this case is Plan control.

This question is come from looking method to set value of Plan field (all
records in subform (continous view) by plan field in mainform.
 
more information
Control in mainform is unbound and same control name in subform
:YearBudg;MaintID;Plan
Thankyou
 
Thankyou for your answer but it still not work.

I already have links masterfield and childfields (YearBudg,MaintID: Same
control name in main and subform) by setting in design form and in some case
I want to add new link for other control in this case is Plan control.

This question is come from looking method to set value of Plan field (all
records in subform (continous view) by plan field in mainform.

You cannot change the value of a field in existing records using the
Master/Child Link Fields.

Also, the Subform *does not contain any data*. You cannot update "a
subform". The data is stored in a Table.

I believe what you need to do is to run an Update query to update the
desired records in the Subform's table.

John W. Vinson[MVP]
 
Back
Top