I'm sure this must be simple, but can't find the correct syntax to make this work.
I have the following code :
relRelation.Fields!Place.ForeignName = "PlaceFirstlogged", where relRelation is a relation set using CreateRelation
I want to replace this with :
relRelation.Fields!strTableField.ForeignName = strForeignTableField where strTableField is a string referring to the main table field and strForeignTableField is a string referring to the Foreign table field.
This gives an error on the first bit relRelation.Fields!strTableField.ForeignName - it says "Item not found in this collection"
What is the correct syntax to make this work?