Chris,
Getting close. But it appears to me that you still have schedule
information in two different places, though I don't know enough about
your situation to be sure. The way I would look at this is that you
have Course Sessions, each of which is tied to a Course, a Classroom,
and one or more Trainers. That way I'd have only one record for each
Course Session, whereas with what you posted it looks to me like you'd
need an entry in tblCourseSchedule AND an entry in tblClassroomSchedule
for each Course Session.
An important thing to remember is that you can build and store queries
on top of your tables. That way you can normalize the basic data but
don't have to think through all the relationships every time you need
to use the data. In most cases, you want to design your database around
the date, then design your queries and forms and reports around your
information needs.
So here's something like what I'd do. (I've changed the prefixes on the
basic fields. Forty years of programming have taught me to name my
variables by function, not form. Thus I've used prefixes that tie the
fields to the table, not to the type of item. However, note that for
foreign keys I've chosen to use the prefix of the foreign table to make
matching easier.)
tblCourseSessions
csCourseSessionID, PK autonumber
coCourseID, FK to tblCourses
csLocationID, FK to tblLocations (obviously I don't understand
what Locations are to you, but that doesn't seem to be critical)
crClassroomID, FK to tblClassrooms
csStart (date/time-- note that it only requires one field)
csEnd (date/time)
csClassSize
csShiftID (not sure what this is, if it just identifies three shifts,
then I'd question whether a table is needed)
csNotes (memo)
csNumCertified
csRoster
csCompleted
(My assumption is that all these items are related to a specific
session -- that is, they could vary from one session to the next, or
are used in tracking the progress of a session. If this is wrong --
which could be true for perhaps class size or notes -- then those items
should be moved to tblCourses.
tblCourses
coCourseID, PK autonumber
coName, text
(anything else related to the course as opposed to just one session,
such as perhaps a link to the syllabus, etc. Even if you only
have the name for now, it's worth keeping a separate table.)
tblTrainers
trTrainerID, autonumber
trName, text
trAnyOtherPersonalInformationAboutTheTrainer
trMaybeInformationAboutRestrictions
tblClassrooms
crClassroomID, autonumber
crName, text
crAnyOtherInformationAboutClassrooms -- depending on the situation,
could be detailed descriptions of various sorts
Now you need the table to establish the many:many relationship between
Source Sessions and Trainers:
tblSessionTrainer:
stKey, autonumber
csCourseSessionID, FK to tblCourseSessions
trTrainerID, FK to tblTrainers
Then bring up the database relationships window and establish
relationships between
tblCourseSessions!coCoursID <-> tblCourses!coCourseID, m:1
tblCourseSessions! (something to locations, I'm not going into
detail since I don't understand locations)
tblCourseSessions!crClassroomID <->
tblClassrooms!crClassroomID, m:1
tblCourseSessions!csCourseSessionID <->
tblSessionTrainer!csCourseSessionID, m:1
tblTrainers!trTrainerID <-> tblSessionTrainer!trTrainerID, m:1
Note that you don't define any m:m relationships to Access, because
Access doesn't do those. The last two relationships, which are cs:st:tr
as m:1:m, establish the m:m from cs:tr.
At the least, you'll want these queries, which you will use as the data
source in some of your forms and reports:
qryClassroomSchedule
use tables tblClassrooms and tblCourseSessions
(Access should automatically pick up the relationship)
select items crName, csStart, csEnd, possibly others
(if you want the course name on classroom schedule reports,
then also use tblCourses and item coName)
the query will have one record for each record in tblCourseSessions
which has been assigned a classroom
if you need to look at sessions without assigned classrooms, you'll
need to change the relationship to use a LEFT JOIN
you can place restrictions on any of the fields (don't worry
about where you started) to limit the results
qryTrainerSchedule
use tables tblCourseSessions, tblTrainers, and tblSessionTrainer
(and perhaps tblCourses and tblClassrooms)
select items trName, csStart, csEnd
(and perhaps coName and crName)
In fact, if you add an ordering to these queries, they would be pretty
useful just in datasheet mode, without even building forms. You'll note
that you've done a lot of work to normalize your data, but then you
haven't used the linking keys in your queries. This is logical -- those
linking keys are internal techniques to describe how the real-world
entities are related, not anything the end user wants to see.
Well, I could go on, even based on the little I know about Access, but
that has to be all for now. I had various thoughts about your tables
and fields, but I think I covered all those thoughts above.
Edward