Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

LinkMasterFields & LinkChildFields properties

Status
Not open for further replies.

jgoodman00

Programmer
Jan 23, 2001
1,510
Does anyone know what the parameters are for setting these properties in VB. The access help file says it can be done, but doesn't say how..... James Goodman
j.goodman00@btinternet.com
 
These properties for a subform container are meant to describe the links between the one table (master) and the many table (subform). Access will automatically fill these properties in for you IF you have properly described the table relationships. To do that merely use the tools/relationships menu to add tables to the builder and describe the relationships between the tables. You can accomplish this only if the Primary Key/Foreign Keys are identical data types. After describing these relationships you should rebuild the subform container. The LinkMasterField will contain the Primary Key from the master table, e.g. UserID, and the LinkChildField will be filled in with the Foreign Key in the many table, e.g. UserID.

You can also do these manually but I recommend the longer and better method.

Steve King
 
I already have the relationships established, but the contents of the subform (form) change, depending on what record is selected. I have posted more detail about this in the forms forum....... James Goodman
j.goodman00@btinternet.com
 
But the contents of the primary key on the main form relate to the foreign key on the subform so the key values do not change by selecting a different record in the subform. When you select a different record with the main for there is a different primary key (because by definition a primary key must be unique) and it will relate to a foreign key in the records displayed in the subform. Don't put the values of the fields in the LinkMasterField and LinkChildField properties but rather the field name.

Steve King
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top