Relationship: one to one trouble :(

deejay_totoro

Registered User.
Local time
Today, 09:38
Joined
May 29, 2003
Messages
169
Hello,

I am trying to work this one out for a while now.

I have a few simple tables. Basically this is my thinking:

Each student has a student record, with name and other details etc..

tblStudentDetails

Each student can attend many courses, so I created another (one-to-many relationship) table:

tblCourseDetails

So, far this is fine. Now here is the problem; students must answer a questionnaire for each course they attend. So my thinking is that there should be another table (tblQuestionnaire) which has a one-to-one relationship with the tblCourseDetails table.

I am thinking this because each student can only have one questionnaire per course.

So - am I correct in choosing one-to-one relationship? And, how do I create a one-to-one relationship?

I have tried linking two fields - Coursename - both Primary Keys. However, the one-to-one relationship appears, but referential integrity cannot be checked. Access says:

"Relationshuo must be on the same number of fields with the same data types."

I am completely stumped :(

Any help would be greatly appreciated!

regards,

dj_T
 
You would be better off to have a questionaire tabler so you only have a single source of the questionaires, or you could combine it with the courses table (if you had to). Then I would create a linking/crossreference table to link the student to the questionaire they filled out, basically a pointer to table that points to the student and questionaire.
As one example.
 

Users who are viewing this thread

Back
Top Bottom