BLUF: How can I have a query that displays all students in one column, all exams in the next column, and a blank column, initially, to enter grades? So the student name would repeat in the first column for each unique exam in the second column. In my case, we have 242 students and 32 exams. That means that there would be 7744 rows in this query That could be filtered by student, classroom, and exam.
I am in the early stages of redesigning a grades database for my institution. I have had alot of help from countless forum members on setting up the initial design and I am feeling good about where it is going.
Well, I have run into a problem right out of the gate. I would like to have a form, preferably splitform, that lists all the students in a classroom along with all the exams they will take. This will allow the instructor to quickly filter the form by exam and then enter in all of the students grades in the bottom datasheet.
I am just beginning to understand relational database normalization and that is what prompted this database redesign. Previously, all the student info along with all associated grades were in the same table. Picture a table with 242 rows (students) and 39 columns of which 32 were the exams.
Background:
***Table Design***
tblStudents
studID (Primary Key)
studName
studClassroom
tblGradedEvents
geID (Primary Key)
geName
tblGrades
studID
eventID
eventGrade
Relationships:
tblStudents.studID has a one-to-many relationship with tblGrades.studID
tblGradedEvents.geID has a one-to-many relationship with tblGrades.eventID
***Query Design***
qryGEventEntry
tblStudents.studName
tblStudents.studClassroom
tblGradedEvents.geName
tblGrades.eventGrade
SQL:
Code:
SELECT tblStudents.studName, tblStudents.studClassroom, tblGradedEvents.geName, tblGrades.eventGrade
FROM tblGradedEvents
INNER JOIN (tblStudents INNER JOIN tblGrades ON tblStudents.[studID] = tblGrades.[studID])
ON tblGradedEvents.[geID] = tblGrades.[eventID];
Now, this code does exactly what it is supposed to do and that is list all students and only those students that have a grade(s) on an exam(s).
***What I am trying to accomplish***
Based on my research, I think it is an outer join but I cant get it to work likely because I have three tables in the query instead of 2. What I'm looking for is a query that will list all students along with an associated exam even if a grade has not been assigned yet. By way of example, lets say there are 15 exams in the tblGradedEvents and 15 students in the school. the query would have a total of 225 rows; 15 rows for each student even if a student has not received a single grade yet.
Thanks in advance,
Sean