Subform Linking via Code

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

Guest

Hello All,
I am trying to change the child/master links for a subform at the click of a
button. The reason for this is to switch between current and completed
projects in the subform. There is already a filter on the parent for which
proved too difficult to amend.

My problem occurs when I click on the button. I get a warning that tells me
that the master and child properties must contain the same number of fields.
Is there a way to bypass this warning so that the rest of my script can run?

Here is the code I have so far:

Private Sub Toggle_Current_Complete_Click()
Me.PMInterfaceSub.LinkChildFields = "Project Manager;Current Status"
Me.PMInterfaceSub.LinkMasterFields = "Project Manager;Status Code"
End Sub

Any help is appreciated. Please let me know if more info in required.

Thanks, Adam Kemp
 
Try putting this as the first line in the sub:
On Error Resume Next

I am not sure that will work, but it is worth a try.
 
Back
Top