I'm setting up a many-to-many relationship between an instructors
table and a class table. 1 Instructor can have many classes. 1 Class
can be held by more then one instructor. I'm using a bridging table
between the 2.
I placed a 3rd table between them that consists of (ID, Instructor_ID,
Class_ID). The Instructor_ID and Class_ID were set to allow
duplicates. These were then linked back to the Instructor and Class
table.
In the form for the class, you may now select an instructor from a
combo box and click on add. The 3rd table is then updated with the
instructors ID and the Class ID. You may do this for multiple
instructors.
The problem I am having is that if you select an instructor, and then
hit add twice, they will be added to the class twice.
Is there a way of setting up some form of protection in the table
itself without having to resort to VBA to scan the table before you
add someting? Can you make the combination of field 2 and field 3 a
unique key?
I'm a bit stumped, as I don't do a lot of work in access and have only
taught myself what I needed to know at the time. So I don't have the
experience to know if this is a simple problem that I've never had to
deal with before.
Thanks.
Craig.