[AccessD] Issues of many-many relationships

Tina Norris Fields tinanfields at torchlake.com
Wed May 4 14:07:02 CDT 2016


Hi,

This should be easy, I'm sure, and I should know how to do it, but I'm 
having trouble with it.

The examples I regularly find that deal with the many-many relationship 
are a bunch like this:

Students --> Student-Class <-- Classes

Where students may take several classes and classes may have several 
students, so, we create a details or junction table, containing the FK 
for student and FK for class - giving us one record for each combination 
of student-and-class.  Great!  But, this depends on existing data in 
both the Students table and the Classes table.

Now, I'm dealing with a slightly different case.  I have a table of 
Persons and a table of their Files.  Each Person could have several 
Files, and each File could apply to several Persons.  (As an example, 
one File could be estate planning for a married couple, so the file 
applies to two individuals.)  Clearly, this is a many-many relationship, 
requiring a junction table.

Persons --> Person-File <-- Files

No problem creating a query to display the files pertaining to any one 
person. But, from here, how to create a new File for an existing 
Person?  The Person-File table cannot have a new entry, because it 
requires an existing matching entry in each of the tables, Persons and 
Files.

So, what the heck am I missing?  What am I doing wrong?  Any help 
getting my brain around this is appreciated.

Thanks
TNF

-- 
Tina Norris Fields
tinanfields-at-torchlake-dot-com
231-322-2787



More information about the AccessD mailing list