Parent-Child Cascading Deletes

Harry Shmedlap

Registered User.
Local time
Today, 23:35
Joined
Aug 9, 2005
Messages
51
I have a simple Family table:

PersonID
Name
ParentID

where, in the case of a child, its ParentID contains the PersonID of its parent.
In the Relataionships window I put two such tables, Family and Family_1 and I joined Family.ParentID to Family_1.PersonID. I set referential integrity, cascading updates and cascade deletes.
I made a Parents form (by setting the ParentID criteria to Is Null), and added a Children subform (linking the ParentID of the subform to the PersonID of the main form).

The cascading updates works when I add a new child but when I try to delete a parent I get the error: Could not update; currently locked.
Why doesn't the cascade delete work?
 
Thanks for the link but it didn't answer my question.
What do I do to stop the error and to allow me to delete a parent and all its children?
 
If a query is used in the parent and a different query is used in the child form, and both use the same table or JOIN on the same table, that is a self-lock. The parent is blocking the update OR the child is blocking the update depending on where you try the delete.

I didn't check the link, but this is a common situation so I thought I'd stab at it.
 

Users who are viewing this thread

Back
Top Bottom