<

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x

How to Enforce Referential Integrity on Access Relationships

Posted on
6,212 Points
113 Views
1 Endorsement
Last Modified:
Experience Level: Beginner
3:24
crystal (strive4peace) - Microsoft MVP, Access
Love empowering people by teaching and helping them develop applications.
The Relationships Diagram is a good way to get an overall view of what a database is keeping track of. It is also where relationships are defined. A relationship specifies how two tables connect to each other.

As you build tables in Microsoft Access, or link to tables that are in SQL Server, Excel range, or other database, put them on the Relationships Diagram

Stretch or shrink fieldlists so everything shows

To create a relationship in Access, click on the Primary Key in the main table, drag to the Foreign Key in the related table, and let go.

In the dialog box that pops up,
check: Enforce Referential Integrity

This is important so that there are not values that don't match up to anything.

Error creating relationship?

If there is bad data, a relationship with referential integrity cannot be created. Fix the bad data and try again.

If the table is linked, you can show it on the diagram but you cannot create a real relationship that is not already there. If relationships are not defined, you can drag lines without enforcing  referential integrity to show what is supposed to match.

Define relationships and arrange the diagram as you build your tables.
Enforce Referencial Integrity unless you have a specific reason not to.

have an awesome day,
crystal
 ~ connect to me, let's build it together
http://www.msAccessGurus.com

Video Steps

1. To create a relationship in Access, open the Relationships Diagram

2. click on the Primary Key in the main table

3. drag to the Foreign Key in the related table

4. and let go of the mouse.

5. When the dialog box pops up, check: Enforce Referential Integrity

6. and click Create

7. Rearrange the Relationships Diagram so everything shows and flows

1
Comment
0 Comments

Featured Post

Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

Join & Write a Comment

When converting amounts between different currencies, you need exchange rates. This article demonstrates how to obtain these from no less than nine different sources, either for free or - for intense or demanding use - for a fee.
Best Disaster Recovery Plans for Exchange 2016, 2013, 2010 environment. Step by Step guide for Exchange Recovery of Server, Database and Mailbox Level after Disaster (Corruption and accidental deletion) recovery using PowerShell Commands and automat…

Keep in touch with Experts Exchange

Tech news and trends delivered to your inbox every month