"Using" Relationships

joltremari70

New member
Local time
Today, 08:19
Joined
Jun 24, 2015
Messages
8
Searching for help with relationships only returns info on how to "make" or '"create" them. I can't seem to find any good information on how to actually use them after you've created them. Please point me to some quality information on how to use relationships after they are created.
Thanks,
JO

P.S. I don't have a need for them at this time, I just want to know...
 
There are four ways you use relationships,
1) Cascade updates/deletes
2) While building a query
3) enforce referential integrity
4) documentation so others can understand your datamodel easily

In any relational database has and needs relationsships!
 
Relationships are not necessary at all - until you actually want to do something that involves somehow relating two tables (or two queries, for that matter). Once you decide that you actually want to relate two tables, you have two choices on how to do that.

First, in the Database Tools tab on the ribbon, you can use the Relationships window to create long-term, "global" relationships between two tables. Second, in any query design grid that involves two tables, you can link fields in the two tables because the upper part of the query design area is a subset of the relationships windows. In that case, the relationship is local to that query rather than global to the database.

You say you know how to define the relationship but not how to use it. But using the relation is actually the easiest part... because you don't use relationships. Access does. The code and design wizards understand relationships. THEY use the relationships. You don't have to. Your work was already done when you defined the relationships.

For example, if you have a relationship between two tables and decide to build a JOIN query between them, the query wizard recognizes the relationship and can build in the right syntax for LEFT JOIN, RIGHT JOIN, or simple JOIN.

If you are building a form with a child sub-form (or a report with a child sub-report), the wizard won't ask you how to link the parent and child forms or reports if a relationship exists. It just does it.

If you built a relationship with relational integrity checked, when you tried to delete something from the parent table, Access would test first whether you were about to violate the integrity rule and it would tell you. There are other things it will do, too, such as if you really want it to delete the parent and all of its children, that is called a "Cascade Delete" - which is an option you could have chosen in the relationship when you defined it.

If you use the database documenter (from the Database Tools ribbon), you don't have to tell it about relationships. It will tell you what you have already established and will draw in appropriate linkages for you.

The point is that you define the relationships but you don't actually do anything special to use them. The documentation is therefore a bit sparse and spread out because it is actually documentation for the query wizards, form wizards, report wizards, documenter wizards, dependency tools, and relational integrity checkers that use them behind the scenes on your behalf.

Does this clarify it for you? And does it perhaps explain better why you can't find more explicit documentation on the topic?
 
I ONLY use it on Parent-child relationships.
like: Order - OrderDetails
(to prevent orphans)
 

Users who are viewing this thread

Back
Top Bottom