You haven't given us a lot to go on, but I'd envisage a set of tables along
these lines:
Classes
………Class
Sessions
………SessionDate
………Class
Attendance
………SessionDate
………Class
………StudentID
Students
………StudentD
………FirstName
………LastName
………<etc>
In the first table, Classes, I'm using the term 'class' to mean the title of
a series of sessions rather than the individual events, so it would contain
unique values of each class title. This would be its primary key of course.
You can of course change the table and column names to whatever you wish, but
one thing I would suggest is that you use the same name for a foreign key
column in a referencing (many-side) table as that for the primary key column
of the referenced (one-side) table.
Sessions would contain unique pairs of values of the date and class title
per session. In this table the primary key would be a composite one of both
columns. The Class column is a foreign key referencing the primary key of
classes.
Attendance models the many-to-many relationship between Students and
Sessions, referencing the primary key of sessions with the composite foreign
key made up of SessionDate and Class, and the primary key of Students with
the StudentID foreign key. So the relationships would look like this:
Classes---<Sessions---<Attendance>---Students
where the < and > signs indicate the 'many' side of each relationship type.
For your report's RecordSource you simply join the last three tables in a
query. You don't need to include the Classes table as the Sessions table
contains the Class titles. This is because 'natural' keys are used here, the
class title text value. If, however, you used surrogate numeric keys, e.g.
ClassID, then you'd also need to include the Classes table in the query to
return the class title. You might think that the Classes table is
unnecessary, but that is not the case as it allows you to enforce referential
integrity in the relationship between Classes and Sessions, thus preventing
an invalid class title from being entered in Sessions. It also means that
the database can include classes for which no sessions have yet been
scheduled.
Note that Students does use a surrogate StudentID key, e.g. an autonumber.
This because personal names can be duplicated so are unsuitable as keys.
Ken Sheridan
Stafford, England