AnsweredAssumed Answered

Automatically Enter Foreign Key from Primary Key

Question asked by JoanneVermulm on Mar 24, 2015
Latest reply on Mar 25, 2015 by philmodjunk


Automatically Enter Foreign Key from Primary Key


I am trying to wrap my brain around primary/foreign keys. I have three tables - Classes, Sections and Teachers. Once a Class record is created, I can create a Section of that class using the Section Portal (located in Class Layout). It automatically creates the Foreign "Class ID" Key in my Sections Table.

Also within the Sections portal, I can choose a teacher based on which department is chosen from a Section portal's drop down field. (The dropdown is related to the Teacher Table only through some secondary TOs of Teacher and some Value Lists).

Without somehow getting the Teacher Foreign Key filled in on the Sections Table, there is no direct link between the Teacher Table and the Sections Table and I cannot see which Sections a teacher is assigned to in the Teacher Layout (through a Sections Portal located in Teacher Layout).

So my question is - how do I get the Teacher ID Foreign Key to populate in the Sections Table when I choose a teacher from the dropdown? I get the need for Primary and Foreign Keys but I always seem to run into the issue of how to get this unnatural field filled-in to connect the tables without using some sort of calculation, which is not best practice for keys, or so I have read.

Any help written as if it were to a second grader would be greatly appreciated.