Problems with duplicate but not duplicate entries

  • Thread starter Thread starter JOHN
  • Start date Start date
J

JOHN

Hey,

I've run into what seems to be a rather large problem, but
hopefully have a relatively easy solution (that I can't
think of).

I am tracking coursework in a database that contains
tables: Profile(Student Information), Training(General
Course information, course name, course number, etc...),
Course (Specific course information, including course
number, section number, instructors etc...) and Results
(Student results).

My primary key throughout the database is the Employee ID
# and have foreign keys including the Course Number. The
problem I am having is if a student takes one course with
one section number and fails the class, my database wont
allow them to retake the same course (same course number)
but with a different section number. Any thoughts would
be greatly appreciated. Thanks a million in advance!!!!
 
Hi,


You probably have an index not allowing duplicated values on (StudentID,
CourseID); incorporate the sessionID field, to have the index on
(StudentID, CourseID, SessionID). Note that a primary key is an index not
allowing duplicated values + not allowing null, so the described index can
be the primary key too ( even if I would avoid pk based on many fields,
generally).


Hoping it may help,
Vanderghast, Access MVP
 
Back
Top