U
unhinged
G'day,
I am trying to match a list of subjects required to a list of student's
results. I want to check programmatically whether or not a student has
achieved a passing grade or better in every subject required to
complete a course.
The tables are (with the key fields and the important data fields):
tStudentResults:
StudentID
SubjectID
CourseID
Competency
Grade
tCourses:
CourseID
QualificationID
tSubjects:
SubjectID
QualificationID
I first create a subquery, sqStudentPassResults:
SELECT tStudentResults.StudentID, tCourses.QualificationID,
IIf(([Competency]="Competent" Or [Competency]="Recognised Prior
Learning") Or ([Grade]<>"Fail"),"Pass","") AS IsPass,
tStudentResults.SubjectID
FROM tStudentResults RIGHT JOIN tCourses ON tStudentResults.CourseID =
tCourses.CourseID
WHERE (((tStudentResults.StudentID)=1) AND
((tCourses.QualificationID)=9) AND ((IIf(([Competency]="Competent" Or
[Competency]="Recognised Prior Learning") Or
([Grade]<>"Fail"),"Pass",""))="Pass"));
As you can see, I have to restrict this query to a single student and
qualification to get the right data set (a student may undertake more
than one qualification).
The "unmatched" query, uqStudentIncompleteSubjects, is this:
SELECT tSubjects.SubjectID, tSubjects.SubjectCode,
tSubjects.SubjectName, tSubjects.SubjectDescription,
tSubjects.QualificationID, tSubjects.SubjectAICLCode
FROM tSubjects LEFT JOIN sqStudentPassResults ON tSubjects.SubjectID =
sqStudentPassResults.SubjectID
WHERE (((tSubjects.QualificationID)=9) AND
((sqStudentPassResults.SubjectID) Is Null));
And again, I have to specify the qualification to limit the data set to
the proper results.
My big problem is, how do I do this in VBA? I want to be able to take a
student record, collect that student's results for a particular
qualification, check to see if all of the subjects for that
qualification are completed successfully, and then allow or deny
certain user actions based on that result.
Any help is much appreciated.
Daniel.
I am trying to match a list of subjects required to a list of student's
results. I want to check programmatically whether or not a student has
achieved a passing grade or better in every subject required to
complete a course.
The tables are (with the key fields and the important data fields):
tStudentResults:
StudentID
SubjectID
CourseID
Competency
Grade
tCourses:
CourseID
QualificationID
tSubjects:
SubjectID
QualificationID
I first create a subquery, sqStudentPassResults:
SELECT tStudentResults.StudentID, tCourses.QualificationID,
IIf(([Competency]="Competent" Or [Competency]="Recognised Prior
Learning") Or ([Grade]<>"Fail"),"Pass","") AS IsPass,
tStudentResults.SubjectID
FROM tStudentResults RIGHT JOIN tCourses ON tStudentResults.CourseID =
tCourses.CourseID
WHERE (((tStudentResults.StudentID)=1) AND
((tCourses.QualificationID)=9) AND ((IIf(([Competency]="Competent" Or
[Competency]="Recognised Prior Learning") Or
([Grade]<>"Fail"),"Pass",""))="Pass"));
As you can see, I have to restrict this query to a single student and
qualification to get the right data set (a student may undertake more
than one qualification).
The "unmatched" query, uqStudentIncompleteSubjects, is this:
SELECT tSubjects.SubjectID, tSubjects.SubjectCode,
tSubjects.SubjectName, tSubjects.SubjectDescription,
tSubjects.QualificationID, tSubjects.SubjectAICLCode
FROM tSubjects LEFT JOIN sqStudentPassResults ON tSubjects.SubjectID =
sqStudentPassResults.SubjectID
WHERE (((tSubjects.QualificationID)=9) AND
((sqStudentPassResults.SubjectID) Is Null));
And again, I have to specify the qualification to limit the data set to
the proper results.
My big problem is, how do I do this in VBA? I want to be able to take a
student record, collect that student's results for a particular
qualification, check to see if all of the subjects for that
qualification are completed successfully, and then allow or deny
certain user actions based on that result.
Any help is much appreciated.
Daniel.