Is there a way to delete a parent record and all related records to it in access 2007?

Trying to find a way to delete a parent record and all related queries in access 2007. I have a form and put the default delete record button but get an error that states it can't be deleted because of relations (which is expected).

Thanks for the help!
jtovar3Asked:
Who is Participating?
 
DatabaseMX (Joe Anderson - Microsoft Access MVP)Connect With a Mentor Database ArchitectCommented:
For the  specific table and it's related tables, to you have Cascade Deleted enabled in that Relationship?

mx
0
 
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database ArchitectCommented:
and can you post a screenshot of the Relationship for just those tables?

mx
0
 
peter57rCommented:
If you absolutely certain that you would ALWAYS want this to happen then you can set Cascade Delete Related Records in the Relationship definition.

You then just have to delete the parent and all related child records will be deleted as well.

This is an extremely dangerous setting to use.   There is no way to prevent automatic deletions if you adopt this setting so as I said, you must absolutely sure about it.


0
Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

 
peter57rCommented:
mmm... the verb 'to be' seems to be missing from my keyboard!!
0
 
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database ArchitectCommented:
IF ... your business rules allow Deleting records, then have no fear of using Cascade Deletes ... a beautiful thing ... otherwise, you will end up with orphan records.

mx
0
 
jtovar3Author Commented:
Didn't know that there was a cascade feature. Thanks!

Also, thank you Peter for the warning. I will take it under consideration!
0
 
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database ArchitectCommented:
Again. I've never seen an issue with Cascade Deletes or Updates.  If you have related tables AND you allow Deletes in a main table, you need Cascade Deletes turned on.

mx
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.