Table linked 1:1 not cascade deleting

D

David Portwood

I have table T1 related 1:M to T2 which is related 1:1 to T3. When I delete
a record from T1, the corresponding records are deleted from T2 but the 1:1
related records in T3 are not. When I inspect the relationship between T2
and T3 I see that the three buttons (first is "Enforce Referential
Integrity") are disabled but Access recognizes that the relationship is 1:1.
Why doesn't the record in T3 delete as well when I delete the master record
in T1? Any idea what could be happening here?

In the form displaying T1 I suppose I could put code in the
AfterDelConfirm() method to delete the record in T3 but it seems like I
shouldn't have to do this. Am I misunderstanding something?
 
J

John W. Vinson

I have table T1 related 1:M to T2 which is related 1:1 to T3. When I delete
a record from T1, the corresponding records are deleted from T2 but the 1:1
related records in T3 are not. When I inspect the relationship between T2
and T3 I see that the three buttons (first is "Enforce Referential
Integrity") are disabled but Access recognizes that the relationship is 1:1.
Why doesn't the record in T3 delete as well when I delete the master record
in T1? Any idea what could be happening here?

In the form displaying T1 I suppose I could put code in the
AfterDelConfirm() method to delete the record in T3 but it seems like I
shouldn't have to do this. Am I misunderstanding something?

The fact that the enforced button is disabled suggests that these are linked
tables, not local; you can't have cascades unless you have an enforced
relationship, and that must be set in the backend database where the tables
actually reside.

John W. Vinson [MVP]
 
D

David Portwood

Yes, they are linked. I'll go into the BE this morning and try to redefine
the relationship.
 
D

David Portwood

You were right, John. I redefined the relationship in the _BE and now
everything cascade deletes properly. Thank you.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top