In one of my earlier blog posts about creating Relationships between tables, you saw the Edit Relationship Dialog Box. I want to take a moment to discuss this Edit Relationship Dialog Box in a little more detail. It did look like this.
So now, what on earth is Referential Integrity and why do you want to know about it? In plain English it simply means data accuracy. Not much help there, is it? So let’s take a look at the actual table information. The Primary table is the tblDepartments table. The information in the table looks like this.
The Related table is the tblEmployees and the information in that table looks like this.
This is why the relationship between the two tables is listed as a one – to – many relationship.
But what does this have to do with Referential Integrity? What it means is if the department code is not listed in the primary table (the tblDepartments) then it can not be listed in the Related Table (tblEmployees). If you add a record that does not meet the Referential
Integrity rule, you should get a message box that looks like this.
Isn’t this a very easy way to make sure that your information in your database stays accurate?
But remember you only get to see the Edit Relationship Dialog Box if you join the tables in the Relationship Window. It does not show the Edit Relationship Dialog Box on screen if you try to join tables together in the query design window.
To hear about the latest Office 2010 news, blogs, and training, subscribe to our newsletter. Click here to subscribe.
Join us and learn more in some of our Microsoft Access 2010 training classes.