Don't delete the children

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,

How do you stop the deletion of the parent if and only if
there are children? I could do a record could of the
children but is there an easier way? Thanks as always
for your assistance.

David S.
 
Hello,

How do you stop the deletion of the parent if and only if
there are children? I could do a record could of the
children but is there an easier way? Thanks as always
for your assistance.

If you have a Relationship between the parent table and the child
table, and check Enforce Relational Integrity - and DO NOT check
Cascade Deletes - you will be prevented from deleting a parent record
if that deletion would leave "orphan" children.


John W. Vinson[MVP]
(no longer chatting for now)
 
Hi,
Enforce referential integrity.
Open up the Relatioships ...
Add the tables and link the relevant fields by dragging
one field to the other.
When the dialog box pops up, check off
"Enforce referential integrity"

Now Access will not let you orphan any child records.
 
Excellent! Thank you.
D
-----Original Message-----


If you have a Relationship between the parent table and the child
table, and check Enforce Relational Integrity - and DO NOT check
Cascade Deletes - you will be prevented from deleting a parent record
if that deletion would leave "orphan" children.


John W. Vinson[MVP]
(no longer chatting for now)
.
 
Back
Top