R
Richard Hollenbeck
I need to pull data from an unrelated table. I cannot, as far as I know,
relate these two tables because they would create a many-to-many
relationship, which I will explain in a second.
Anyway, I need to insert studentID from the StudentsInCourses table into new
records in the StudentGrades table. When I open the "Add Student Grades"
form, it won't display the roster of students in the class because there
the composite key between the Students table "studentID" and Activities
table "activityID" isn't yet satisfied. Once I enter a studentID, all is
fine; because the form is filtered for "activityID," the composite key is
satisfied and a new record is created. I can then enter a score for that
student in that activity. But the Students table doesn't know which
students are in which course. Therefore, it won't prohibit me from entering
the studentID of a student who is in another course.
The StudentsInCourses table is on the many side of a 1:M relationship with
both the Students table and the Courses tables. The StudentScores table is
on the many side of the 1:M relationship with the Students table and also is
indirectly related to the Courses table (via Activities) and is on the many
side.
In other words, both StudentsInCourses and StudentScores are on the many
side of both Students and Courses. So I really can't relate StudentScores
with StudentsInCourses, I don't think so anyway. It would create a
many-to-many nightmare--wouldn't it?
So if I cannot relate the two tables, how do I limit a list of students in
the StudentGrades table to students in a particular course? Is there a
clever work-around? Is there some kind of pseudo relationship I could
create programmatically just for this one purpose with no permanent
relationship?
relate these two tables because they would create a many-to-many
relationship, which I will explain in a second.
Anyway, I need to insert studentID from the StudentsInCourses table into new
records in the StudentGrades table. When I open the "Add Student Grades"
form, it won't display the roster of students in the class because there
the composite key between the Students table "studentID" and Activities
table "activityID" isn't yet satisfied. Once I enter a studentID, all is
fine; because the form is filtered for "activityID," the composite key is
satisfied and a new record is created. I can then enter a score for that
student in that activity. But the Students table doesn't know which
students are in which course. Therefore, it won't prohibit me from entering
the studentID of a student who is in another course.
The StudentsInCourses table is on the many side of a 1:M relationship with
both the Students table and the Courses tables. The StudentScores table is
on the many side of the 1:M relationship with the Students table and also is
indirectly related to the Courses table (via Activities) and is on the many
side.
In other words, both StudentsInCourses and StudentScores are on the many
side of both Students and Courses. So I really can't relate StudentScores
with StudentsInCourses, I don't think so anyway. It would create a
many-to-many nightmare--wouldn't it?
So if I cannot relate the two tables, how do I limit a list of students in
the StudentGrades table to students in a particular course? Is there a
clever work-around? Is there some kind of pseudo relationship I could
create programmatically just for this one purpose with no permanent
relationship?