I expect you will still need the unique constraints on the other two tables.
You typically need a "third" table to model *many*-to-many relationships.
For example, if you have
PATIENTS:
PATIENT_ID, PATIENT_NAME,...
1, John,...
2, Bob,...
3, Mary,...
.
.
.
and
CONDITIONS:
CONDITION_ID, CONDITION_NAME,...
1, Measles,...
2, Mumps,...
3, Rubella,...
4, Chicken Pox,...
.
.
.
You might want to keep track of when patients were diagnosed with certain
conditions (which in this case could happen more than once) using a table
like this:
DIAGNOSES:
DIAGNOSIS_ID, PATIENT_ID, CONDITION_ID, DATE_DIAGNOSED,...
1, 2, 1, 1/1/2004,...
2, 2, 2, 2/1/2004,...
3, 2, 1, 10/1/2004,...
4, 3, 2, 10/14/2004,...
.
.
.
So, John was diagnosed with measles on January 1 and again on October 1.
John was also diagnosed with mumps on February 1, and Mary was diagnosed
with mumps on October 14.
In this example, you might have a unique constraint on PATIENT_ID,
CONDITION_ID, and DATE_DIAGNOSED. This allows many patients to be diagnosed
with the same condition, the same patient to be diagnosed with many
conditions, and the same patient to be diagnosed with the same condition
more than once, but not on the same date.
Sometimes, the combination of foreign keys in these kinds of "junction"
tables is unique by itself.
> I guess I don't really need the third table; I was building it that was at
> the suggestion of someone else to better handle the one-to-many relationship.
[quoted text clipped - 98 lines]
> > > > >
> > > > > Is there an easy fix to get the triggers working in Access?
slapana - 14 Dec 2004 19:43 GMT
That's exactly what I need!!! Thanks!
> I expect you will still need the unique constraints on the other two tables.
>
[quoted text clipped - 184 lines]
> > > > > >
> > > > > > Is there an easy fix to get the triggers working in Access?