One-to-one relationships

  • Thread starter Thread starter Jack Sheet
  • Start date Start date
J

Jack Sheet

When creating a one-to-one relationship between two tables, does it ever
make a difference which table you drag across to the other? If it does,
could someone please in layman's terms briefly explain the significance?
Thanks
 
Jack,

When you say "...which table you drag across to the other?", I assume you
means dragging the relationship line from one table field to another. It
makes no difference which direction you go - it works out the same.

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia
 
Graham

There does seem to be a difference which direction you go.
I tried it out with two tables:

T_Table1 contains two fields
Table1ID = autonumber, primary key
Table1Field = text, indexed, no duplicates

T_Table2 contains two fields
Table2ID = autonumber, primary key
Table2Field = text, indexed, no duplicates.

Before adding any records to either table I created a one-to-one
relationship by dragging Table1Field on to Table2Field, and enforced
referencial integrity.

The difference in effect that I have observed is that I seem to be allowed
to add new records to T_Table1 even though there is no corresponding record
in T_Table2. But it will not allow me to add a record to T_Table 2 unless
there is an identical record in T_Table1.


Graham R Seach said:
Jack,

When you say "...which table you drag across to the other?", I assume you
means dragging the relationship line from one table field to another. It
makes no difference which direction you go - it works out the same.

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia
---------------------------
 
Jack,

Yes, it seems I was wrong. Sorry. I guess I've never thought about it
before, because I've always gone from primary key to foreign key as a matter
of course; I've never considered going the other way.

Based on experiment, the first table selected is considered to be the
generalised (parent) table, whereas the second table becomes the specialised
(child) table.

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia
---------------------------

Jack Sheet said:
Graham

There does seem to be a difference which direction you go.
I tried it out with two tables:

T_Table1 contains two fields
Table1ID = autonumber, primary key
Table1Field = text, indexed, no duplicates

T_Table2 contains two fields
Table2ID = autonumber, primary key
Table2Field = text, indexed, no duplicates.

Before adding any records to either table I created a one-to-one
relationship by dragging Table1Field on to Table2Field, and enforced
referencial integrity.

The difference in effect that I have observed is that I seem to be allowed
to add new records to T_Table1 even though there is no corresponding
record in T_Table2. But it will not allow me to add a record to T_Table 2
unless there is an identical record in T_Table1.
 
Back
Top