Results 1 to 3 of 3
  1. #1
    Join Date
    May 2015

    Unanswered: Database help, in the subform "You cannot add or change a record because a related"

    I am having these error.
    "You cannot add or change a record because a related record is required in table"

    I am wondering if someone can help me with this problem in the sub-form when i am trying to add the data (glass performance data)
    I used the query as my friend said.

    I am new to database world if you can correct me if i am wrong in making the database.

    Thank you very much in advance and really appreciate your help.

    So the relationship in between three table are one customer can have many project and one project can have many glass performance.
    So i built the query but i am not sure that is the correct one, basically in the query i added all of the information such as CustName, CustAddress etc plus ProjectID, ProjectName, then in the third table(zKaca...) : GlassID,ProjectID,GlassDesc,etc.

    I linked (using relationship) from the first table to the second table by CustID, and the second to the third by ProjectID.
    Attached Thumbnails Attached Thumbnails Untitled.jpg  
    Attached Files Attached Files

  2. #2
    Join Date
    Nov 2004
    out on a limb
    Provided Answers: 59
    that error message usually occurs because you are trying to insert a row into a table that has a foreign key constraint. In this case Im guessing you are trying to insert a row into Project and there is no matching valuer in Customer for the the CUSTID you are trying to insert into Project
    I'd rather be riding on the Tiger 800 or the Norton

  3. #3
    Join Date
    Jun 2005
    Richmond, Virginia USA
    Provided Answers: 19
    The Jaded Developer is dead on, here, vis--vis the error message; after all, you have a parent (record) before you can have a child (report)...don't you?

    Your Form/Subforms are based on the appropriate Tables, as they should be, with the relationships, as you currently have them, set up correctly.

    So what is the purpose of the Query? Multi-table Queries are frequently Read-Only.

    Linq ;0)>
    Hope this helps!

    The problem with making anything that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts