Help With LinkMasterFields/LinkChildFields

Mallol02

Registered User.
Local time
Today, 12:07
Joined
Feb 23, 2009
Messages
15
Hi, i'm trying to create a form that uses and unbound subform; this is the easy part but, that unbound subform will change change when i click a CMD botton. and also the LinkMasterFields/LinkChildFields will change because i'm changing that subform to another subform. this is the code i'm using, but they are not linking together.

Private Sub Command62_Click()
If Form1.SourceObject <> "TABLA-PERFIL-ESTUDIANTIL subform" Then
Me.Form1.SourceObject = "TABLA-PERFIL-ESTUDIANTIL subform"
Me.Form1.LinkChildFields = Forms![Copy Of Form_Principal]![CODIGO].Value
Me.Form1.LinkMasterFields = Forms![Copy Of Form_Principal]![CODIGO].Value
Me.Form1.SetFocus
End If
End Sub

Thanks in advance
 
MASTER/CHILD links do not work with UNBOUND subforms as there is no binding for them to link on.
 
Thanks, i understand that but also i'm changing the SourceObject to one form that actually i can use the Master/Chield.
 
In the sample code you provided, you were trying to set the links to the same thing. But they can't be the same. One has to reference something on the main form and one has to refer to something on the subform. Now, if it is a field then you can just use the field name:
Me.Form1.LinkChildFields = "[FieldName]"
Me.Form1.LinkMasterFields = "[FieldName]"

But if you need to refer to controls then you will have to specify the correct syntax for each - master form and subform.

Also, is FORM1 the actual name of the subform CONTAINER control (the control that houses the subform on the main form)? If not, that name needs to be referenced.
 
Boblarson, Thanks for the Help that was my problem i was not looking on the names in my Master/Child fields hehehe i feel like *^&%^...

You have provide me a great help, thanks
 
Boblarson, Thanks for the Help that was my problem i was not looking on the names in my Master/Child fields hehehe i feel like *^&%^...

You have provide me a great help, thanks

Glad you are back on track! :)
 

Users who are viewing this thread

Back
Top Bottom