473,322 Members | 1,417 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

I am not Able to delete certain record due to key violation.

Please help me out to solve my issue. I am Using MS Access I want to delete record form main table where checkbox is unchecked. but i am getting a prompt that you can not delete certain rows due to key violation. This is because the other tables are related with Main "Info" table.
But i dont know hoe to deal with it. Nad whet is teh other solution to delete records from a table. All the related data from other related tables should be deleetd as well.
Sep 15 '10 #1
1 12743
TheSmileyCoder
2,322 Expert Mod 2GB
Hi and welcome to bytes
You dont write which access version your using, however, In AC2000,2002,2003 you will find in your toolbar a button called relations. (Don't know where it is in 2007). In here you can see and edit the relations between tables, and their primary/foreign keys. If you can't find the relations button, search for it in help.

Locate the table you want to delete records from in the relations view, and note which tables it is related to.
Now you know which tables you need to delete records from as well. The error msg you get is telling you that there are related records in these related tables, that if you delete the record from the primary table, these related records will be "orphans".

Now if you (double) click the link between the tables, you can modify the link properties. Selecting "Cascade delete related records" will make access delete all related records when you delete from the primary table.

Id also suggest you do quick read up on "relational databases" (just google it).
Sep 16 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Maria | last post by:
Is there another way to delete the current record in a subform from the main form, another subform or a sub-subform other than setting focus on a field in the subform and using run command...
4
by: Susan Bricker | last post by:
I have a command button on a form that is supposed to Delete the record being displayed. The record is displayed one to a form. The form is not a Pop-Up nor is it Modal. Tracing the btnDelete...
0
by: HS1 | last post by:
Hello all I have a DataGrid1 presenting records of a table ("clients") in a Access Database through a DataSet (ds) using DataAdapter (da1) and buttons "add", "save" and"delete" buttons with the...
3
by: kaosyeti | last post by:
i have a form that has required fields and i have a delete button, created by the wizard, that has this code for onclick: Private Sub cmddeleterecord_Click() On Error GoTo...
3
by: Bobbie | last post by:
One of my records is returning garbage. I tried to delete the record it a message comes back and says Search Key Cannot be found. I don't know what happened to the record but I sure need to get...
5
by: agarwasa2008 | last post by:
Hi, I would like to delete a record based on a user entered string. Here are the details. I have a txtFind textbox. A string is entered by the user. Based on that string value it displays that...
10
beacon
by: beacon | last post by:
Hi everybody, This is probably going to sound unorthodox, but I have to log records that are deleted...I know, go figure. Anyway, I have a form with a (continuous) subform, and on the subform I...
13
by: rnashting | last post by:
Good Day everyone! Here's what I'm trying to do in a nutshell. I have a table that I want to allow people to manipulate via forms. I'm using unbound forms because I don't want users to be able to...
9
by: Will The Gray | last post by:
I am trying to load certain data from a table into a recordset and then working with it without affecting the data in the tables. The idea is to post all records in a table (given a certain...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.