Solved

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

Posted on 2011-02-28
7
217 Views
Last Modified: 2012-05-11
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!
0
Comment
Question by:jtovar3
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
7 Comments
 
LVL 75

Accepted Solution

by:
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform) earned 500 total points
ID: 34999225
For the  specific table and it's related tables, to you have Cascade Deleted enabled in that Relationship?

mx
0
 
LVL 75
ID: 34999236
and can you post a screenshot of the Relationship for just those tables?

mx
0
 
LVL 77

Expert Comment

by:peter57r
ID: 34999255
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
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 
LVL 77

Expert Comment

by:peter57r
ID: 34999265
mmm... the verb 'to be' seems to be missing from my keyboard!!
0
 
LVL 75
ID: 34999599
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
 

Author Closing Comment

by:jtovar3
ID: 34999725
Didn't know that there was a cascade feature. Thanks!

Also, thank you Peter for the warning. I will take it under consideration!
0
 
LVL 75
ID: 34999831
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

Featured Post

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question