There's a great deal more required here to get this to work.
Over time, you repeat a subject (such as Algebra I) several times. You
therefore need a table of Subjects, as well as Classes, with a one-to-many
relation (since once subject is repeated in many classes.)
Now you need a table to define the subjects that are prerequisites for a
subject. It will have fields like this:
- SubjectID what subject needs the prerequisite.
- PriorSubjectID what subject is the prerequisite for the SubjectID.
In the Relationships window, you will need 2 copies of the Subjects table.
Access will alias the 2nd one as Subject_1.
You can now create two relationships:
- Subjects.SubjectID to SubjectsPriorsubject.SubjectID
- Subjects_1.SubjectID to SubjectsPriorsubject.PriorSubjectID
Now, your Classes table needs fields such as:
ClassID AutoNumber primary key
SubjectID Number which subject this is
StartDate Date/Time the date (or semester) this class starts
LecturerID Number who is supervising this course.
The students don't go in the Classes table. Since one class contains many
students, you need another table to record who's in what classe. This
ClassStudent table will have fields like this:
ClassID Number which class this row is for
StudentID Number which student is in this class.
You will also need some way of recording the classes the student has passed.
Now you need some code in the Form_BeforeUpdate event procedure of the form
where you enter students into classes. Your code can then look up the
subject the code is for, the prerequisites for the subject, and see if any
of them is missing from the classes the student has passed.
That's the core idea. There are also heaps of other aspects, such as the
assessments for the class, the assignments submitted by each student (don't
forget the possibilty of resubmits), grading criteria, attendance at
classes, and so on. Oh, and enrolling in a course is a whole other area (in
addition to the actual classes the students are taking.)
Finally, it would be good to avoid problem field names like Name and Class:
Access will misunderstand Name (to be the name of the form or report,
instead of the contents of the Name field), and Class is a future-reserved
word for SQL Server. Here's an extensive list of the names not to use:
http://allenbrowne.com/AppIssueBadWord.html