Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

What good are Relationships

Status
Not open for further replies.

bronc

Instructor
Aug 28, 2003
145
GB
We can

1. set up relationships between two tables eg a one to many and eg set the join type to 1,2 or 3 and save this layout.

We can then 2. make a query for the same two tables and maybe choose a different Join type.

I don't understand why we need to perform 1. above.

Does this just set the default relationship which can then be over-ridden?

ie what is the relationship between these relationships?


 
Regardless of what Join Type (Inner, Left, or Right) you selected when you created the relationship, your queries can still have different join types. So, yes, setting the Join Type at the Relationship window does just set the default type of join.

I hope others will chime in, but as for me, I generally leave the Join Type at the default (Inner) in the Relationship Window, and alter join types in queries when necessary.

--Lilliabeth
 
You can enforce referential integrity using the relationship window. This would prohibit users from creating child records without a parent. For instance you wouldn't be able to create order details without an order.

Duane
Hook'D on Access
MS Access MVP
 
By defining a relationship there are several very important things that can be done.

1)Enforce relational integrity. You can not add a child record without a parent. You can not delete a parent with children.
2) Cascade updates. Change the parents primary key and update all children foreign keys
3) Cascade deletes. Decide if you want to delete child records when you delete a parent record.
 
Well thanks for that. I never noticed that you can only enforce RI from the Relationship window.

And I guess that the Join Type set at the the Relationship window is just the default?

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top