Relationships - Enforce Referential Help

OminousDaark

New member
Local time
Today, 22:21
Joined
Dec 22, 2013
Messages
8
Hello, So I have a database and so far all of my relationships are working as they are intended although I now have two tables the Staff table and the Orders Table and I am trying to Enforce Referential Integrity although I keep getting the error

"Microsoft Access can't create this relationship and enforce referential integrity.
Data in tblOrder violates referential integrity rules. For example there may be records relating to an employee in the related table, but no record for the employee in the primary table."

tblStaff is the one table and tblOrders is the Many table. I have no clue why this is doing this I am simply trying to make it so that Staff cannot be deleted if they appear in any of the orders.

If anyone can help me that would be awesome. Thanks a lot

Ominous
 
You already have the answer.

"Data in tblOrder violates referential integrity rules"

Your rule says there are customer records for every order but their are orders with no valid customer record.
 
You already have the answer.

"Data in tblOrder violates referential integrity rules"

Your rule says there are customer records for every order but their are orders with no valid customer record.

Sorry, Do you know how I can fix it? I am not very good with Microsoft Access at all, Any help is appreciated.
 
Find the records that break the rule.

Do an Outer Join from Orders to Customers on the CustomerID with a criteria of Is Null on the field in the Customer table.
 

Users who are viewing this thread

Back
Top Bottom