Full Version: How do I modify the ChildLink and MasterLink properties on a sub
UtterAccess Discussion Forums > Microsoft® Access > Access Forms
MsfStl
Hello,

I have a subform that is filtering out data based upon what is being shown on the main form. I have diagnosed that it is related tothe ChildLinkFields and the MasterLinkFields properties. Is there a way to remove those or say ALL?

Scot
theDBguy
In the design view of the main form, click on the subform container and go to the Properties window. In the Data tab, find the Link Child Fields and Link Master Fields properties and delete them.

In code, you can try:

Me.SubformControl.LinkMasterFields = ""
Me.SubformControl.LinkChildFields = ""

Hope that helps...

Edited by: theDBguy on Thu Apr 17 16:59:53 EDT 2008.
MsfStl
I placed the code:
CODE
Me.subSched2.LinkMasterields = ""
Me.subSched2.LinkChildFields = ""


And I received an error: "Method or Data Member not found."

:(
Scot
theDBguy
Did you put the code in the main form's module? Also, make sure subSched2 is the container's name and not the subform's name. Hope that helps...
MsfStl
Please forgive my lack of knowledge. I removed the any Links in the child and Master Link properties on the Data tab and I was still getting a filtered subform, eventhough the Links no longer show up when checking those properties.

now, as far as the code is concerned, I don't believe i am following you. The main form is named: frmSched and the sub form is named: subSched2

Yes, I did put the code in the main form's module. Is that not correct?

When you say container's name you are referring to the main form, correct?

So, what I was doing in the Main Form Load event was:
CODE
Me.subSched2.LinkMasterFields = ""
Me.subSched2.LinkChildFields = ""


Is that not correct? I know I am clueless on this one. Sorry about that.

Scot
theDBguy
Deleting the entries in the Data tab still gives you a filtered subform? That's odd. There must be something else we need to check but I'm not sure where to start.

About the code, you need to put it in the main form's module (that's what you did, so you're good).

The main form's name is frmSched, the subform's name is subSched2, but the subform container might be different than the subform's name.

Do this, while in the design view of the main form, click on the outside border of the subform and check the properties box. Make sure it says "Subform/Subreport" in the title bar and not "Form." If it says Form, try clicking again on the very edge of the subform until you hit it right so it says Subform/Subreport. Once you get Subform/Subreport go to the Other tab and see what is in the "Name" property. That would be the name of the subform control/container.

Hope that helps...
MsfStl
Ok, the subform's 'container' is called subSched2. And I still get the filtered data.

Its driving me bananas. I thought it might be the subform, earlier, so I created a 2nd one , hence the name subSched2. But, it is still performing this way.

If I open the subform by itself it displays the correct data. I have also double checked all my queries (used to set the recordsource) and they look good. I can't for the life of me figure this out.

I hate it when it behaves like this, because I end up wasting so much time on one issue. Forgive, my agitation, but I am pressed to stabilize this program, and things like this frustrate me endlessly.

However, I must say, I am very grateful for all the help I have received in this forum. I have learned so much by utilizing everyones experience.

Scot
theDBguy
Hi Scot,

We're happy to help; however, in this case, it would be hard for us to help you troubleshoot without seeing what you got. I hope you find a solution (and if you do, please let us know so we can help others later). Good luck with your project.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.