Setting Link fields

Matt Greatorex

Registered User.
Local time
Yesterday, 19:52
Joined
Jun 22, 2005
Messages
1,019
This is connected to a thread I posted under the 'Forms' forum. I'm hoping someone browsing this area might have an idea.

Is it possible to set the Link Master Fields and Link Child Fields of a Subform, from it's 'master' Form, using VBA?
 
Last edited:
Me.MySubformName.LinkChildFields = "FieldName"
Me.MySubformName.LinkMasterFields = "FieldName"
 
Code:
Me.frmSubForm.LinkMasterFields = "blah"
Me.frmSubForm.LinkChildFields = "blah"

frmSubForm is actually the Sub-Form Container, not the form itself.
 
All object properties can be set with code.

Me.SubForm.LinkChildFields = "something"
Me.SubForm.LinkMasterFields = "something"
 
ghudson said:
All object properties can be set with code.

Me.SubForm.LinkChildFields = "something"
Me.SubForm.LinkMasterFields = "something"

I love how he asked the question once, and was answered 3 times with the exact same answer ^_^.

I guess we all hit post reply at the same time.
 
...and I love the fact that it now works!

I had been trying something similar, but didn't think of joing all the words together (LinkMasterFields as opposed to [Link Master Fields]).

I had an initial problem with the fact that I was trying to set the links to use one field under certain conditions, and three fields under others. I changed them to use three under both conditions, and all is well.

Thanks to all for the help.
 
F2 In the VBA Module will open the object explorer. You can look up function names and methods/properties that each kind of object has.
 
Will try that next time, before bothering the kind people of the forum.
 

Users who are viewing this thread

Back
Top Bottom