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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Primary key update

Status
Not open for further replies.

rasticle

Programmer
Sep 25, 2006
42
US
Okay I don't know how to word this so it is not complicated. So I will give this my best shot, let me if it doesn't make any sense.

I have 3 tables that are linked: tblFacility, tblEnforcement, and tblInspection. Each table uses the same value for a key. On the form I am working with, it is bound to tblFacility. When I try to change the key value, which is the facility ID number, it gives me this error: "The record cannot be deleted or changed because tblEnforcement includes related records."

Is there some VBA code I can use to update the other tables so I don't keep getting this error?
 
Hi, rasticle,

When you say your tables are linked, what do you mean? That you have created relationships between them? If so, what kind of relationship? Have you set referential integrity, and cascade updates and deletes?

Ken S.
 
Oh, I guess if I turn on Cascade it should update? But it is greyed out. Facility is the main table, and yes there is referential integrity. They have have a relationship 1 to many. What can I do to make them not greyed out?
 
If your database is split you have to change the relationships on the back-end.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top