Solved

Unable to delete record from a main Access table linked to two tables

Posted on 2011-09-11
5
523 Views
Last Modified: 2013-11-28
Hi Guys,

I have an Access DB (Action) Query with two 3 tables. The first (main) table is linked to two tables.  The query displays the code from the main table and the rest of the two columns come from the second and third tables.

When I pressed the Delete button on a record in the query grid, the record gets removed from the grid and prompted "You are about to delete 1 record(s)".  Selecting "Yes" goes back to the grid and the deleted record is not displayed.

But closing and re-loading the script, the deleted record still exists.  Why is the Delete action was not applied in the database.  

I can edit the query column for the record from the secord and third tables without any issue.  Edited value persist next time the query is re-loaded.

Thanking you in advance.

0
Comment
Question by:warrenrapson
5 Comments
 
LVL 13

Assisted Solution

by:khairil
khairil earned 167 total points
ID: 36520925
Hi,

Try check table relationship, record will not be deleted if there is reference in other table and relationship does not set to cascade delete.
0
 
LVL 34

Accepted Solution

by:
Mike Eghtebas earned 333 total points
ID: 36839808
In deleting data involving number of tables, you have to either:

1. Delete the related data in tables with FK and then delete the record in the table with PK.

2. In table relationship screen right click on the relationship lines between these three tables, select edit. Then enforce cascade on delete option.

Mike
0
 
LVL 34

Assisted Solution

by:Mike Eghtebas
Mike Eghtebas earned 333 total points
ID: 36840705
If database allows you to delete records from table with PK, then you will have orphan records left in the other tables and this is considered violation of database referential integrity.

Mike
0
 
LVL 30

Expert Comment

by:hnasr
ID: 36914698
Reproduce the issue with a simple db and attach.
0
 

Author Closing Comment

by:warrenrapson
ID: 37863763
Thanks guys, I was sidetracked by various projects.  The temporary solution I implemented was a code-behind the delete record event of the grid and deleted the record with an sql script.  

Given such response, I believe each one had merits an as such I accept multiple solutions.

Thanks again...

Cheers.
0

Featured Post

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

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…
This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

756 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