Solved

You cannot add or change a record because a related record is required in table

Posted on 2009-07-10
4
431 Views
Last Modified: 2012-05-07
I have a slight problem that is driving me nuts. I get the following error You cannot add or change a record because a related record is required in table PartsOrg I have a subform that is populated by a combobox from the Parts table. I renamed it to PartsOrg and created a new table called Parts from a create table query and populated it with the data from the PartsOrg, I then ran an update query that appended new data to the Parts table, both tables have the same schema but anytime one of the appended items is selected to populate the form I get the above error but not with items that were originally in the table, just the appended ones. I have checked all my forms, queries, and reports and all point to the Parts table and not the PartsOrg table. However when I checked the Object Dependencies on the Parts table PartsOrg shows up in both Objects that depend on me and Objects that I depend on. I checked the Relationships but PartsOrg is not there. See screen shot
PartsTblOBJ-I-Depend-On.jpg
0
Comment
Question by:skull52
  • 2
4 Comments
 
LVL 84
Comment Utility
Do you have a Relationship diagram you can show?
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
Comment Utility
<No Points wanted>

The error basically means that you are trying to add a Child Record for a Parent Record that does not exist.
For example:
tblCustomers
CustID, CustName, CustEmail
22, ABC inc, abc@abc.com
25, XYZ Corp, xyZ@xyz.org
77, 123 Publishing, 123@123.Net

tblOrders
OrderID, CustomerID, OrderDate
1289, 37, 1/18/2009

Here you are trying to place an Order (Child Record) for a Customer (37) that does not exist in the Parent Table.

So "Somewhere" in your Process, this is what is happening.

I am sure LSM, can help you through this.
;-)

JeffCoachman
0
 

Accepted Solution

by:
skull52 earned 0 total points
Comment Utility
Jeff,
Thanks for the explanation that's what was driving me crazy I couldn't find any relationships to the old table in my forms, quires , or reports so what I did to rectify the situation was to delete the old table as i no longer needed it which removed all relationships and that seemed to work
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
Comment Utility
;-)
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

In the article entitled Working with Objects – Part 1 (http://www.experts-exchange.com/Microsoft/Development/MS_Access/A_4942-Working-with-Objects-Part-1.html), you learned the basics of working with objects, properties, methods, and events. In Work…
Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

763 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now