Thanks John, That was a most helpful answer. If you could now explain in the
same wonderful simple and clear manner how junction tables are actually
populated, I would be eternally grateful. I understand (on a basic level)
about making Primary Keys and Joining tables, but then do you do the entries
through a form or query or both? And what happens if the Junction table
becomes corrupted. That's something that I worry about, since every table I
have as the linking student ID or otherlink as a field and these tables
won't. Do you mind answering all this first and then I have some other
questions about the Enrolment table. thankyou, thankyou.
Typically you would use a Form with a Subform to populate the tables. For your
enrollment example you could do it either (or both!) of two ways. One way
would be to have a Form based on the students table, into which you could add
students; on this Form you would have a Subform, based on the Enrollment
table. This subform would use the StudentID as the master and child link
field; this would show all the sessions in which that student is enrolled, and
automatically populate the StudentID from the mainform into the enrollment
table when you add a new record to the subform. On the subform you would have
a Combo Box based on the TrainingDays table, to allow you to enrol the
currently displayed student into any (or many) of the classes.
The flipside would be to have a form based on the class session, with a
Subform letting you pick a Student from a combo box. Which you use depends on
your workflow and whatever works best for you.
You needn't worry about corruption per se. If you have a Relationship defined
between the Student table and the StudentID in the Enrollment table, and
similarly a relationship between the schedule table and the enrollment table,
with referential integrity enforced - then Access will see to it that you
*CANNOT* add a record with invalid foreign keys, nor would you be able to
delete a student or a class if doing so would leave an "orphan" record in the
enrollment table.
I'm not certain what you mean by
every table I have as the linking student ID or otherlink as a field and
these tables won't
What's "otherlink"? What tables won't have ID's???
Take a look at the Orders form in the Northwind sample database for an example
of how this can work. The analogy is direct:
Orders ----> Students
Products ----> TrainingDates
OrderDetails ---> Enrolment