Group:  Microsoft Access ยป microsoft.public.access.gettingstarted
Thread: Why linkchildfields code not work

DotNetBag
.NET Development Newsgroups

HTVi
TV Discussion Newsgroups

Our Hot Pick: Rising Antivirus 2006 - Certified by TUV & Checkmark! Get 10% discount by entering this coupon code: ONDISCOUNT10
Rising Antivirus 2006

Why linkchildfields code not work
Nova 28.07.2006 09:22:02
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

Re: Why linkchildfields code not work
John Vinson <jvinson[ at ]STOP_SPAM.WysardOfInfo.com> 28.07.2006 18:41:55
On Fri, 28 Jul 2006 02:22:02 -0700, Nova
<Nova[ at ]discussions.microsoft.com> wrote:

[Quoted Text]
>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]
Re: Why linkchildfields code not work
Nova 01.08.2006 04:43:01
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.


[Quoted Text]
> 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]
>
Re: Why linkchildfields code not work
Nova 01.08.2006 05:16:02
more information
Control in mainform is unbound and same control name in subform
:YearBudg;MaintID;Plan
Thankyou



Re: Why linkchildfields code not work
John Vinson <jvinson[ at ]STOP_SPAM.WysardOfInfo.com> 01.08.2006 18:42:06
On Mon, 31 Jul 2006 21:43:01 -0700, Nova
<Nova[ at ]discussions.microsoft.com> wrote:

[Quoted Text]
>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]
Re: Why linkchildfields code not work
Nova 02.08.2006 03:33:01
Update query is a good solution.

Thank you again for your Answer


Home | Search | Terms | Imprint | Contact
Newsgroups Reader - provided by WiredBox.Net