Results 1 to 7 of 7
  1. #1
    Join Date
    Oct 2006
    Posts
    17

    Unanswered: Error Message [Form]

    I need help! I dont know how to get rid of this error message. I need the relationships to be enforced, so it will update my table. But how do i go about doing this?

    The Error Message Says :

    "You cannot add or change a record because a related record is required in 'TblOrder'.

    I have attached a JPG of my relationships..

    any adivce??

    Thanks in advance

    The database is a for a take-away system.
    Attached Thumbnails Attached Thumbnails Relationships.JPG  

  2. #2
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    Uh yeah ... Either write out the dependent record(s) or drop the relationship between the 2 tables ...
    Back to Access ... ADO is not the way to go for speed ...

  3. #3
    Join Date
    Jun 2005
    Location
    Richmond, Virginia USA
    Posts
    2,763
    Provided Answers: 19
    M Owen's pretty much said it! You've got to do one or the other!
    Hope this helps!

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

    All posts/responses based on Access 2003/2007

  4. #4
    Join Date
    Oct 2006
    Posts
    17
    what you mean by writing out the dependent records? I cant drop the relationships they have to be in place.

  5. #5
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    Quote Originally Posted by 1heng
    what you mean by writing out the dependent records? I cant drop the relationships they have to be in place.
    It means that the TblOrder record(s) needs to be written before the record you're trying to write gets written ... In your relationship you have either Cascade Update and/or Delete set with a 1 to 1 or 1 to many join ... How have you set this join? From which table to which table?
    Back to Access ... ADO is not the way to go for speed ...

  6. #6
    Join Date
    Feb 2004
    Location
    Chicago, IL
    Posts
    1,312
    When you see that message, Access is enforcing the referential integrity. Essentially, you are adding order details without first adding an order record. The real question is how are you entering the data? What do your forms look like?

    This scenario, a one-to-many relationship (one order many order details/dishes), is an ideal scenario for a main form (Order information) with an embedded subform (Order Details). When you set this up and you properly link the main form and subform, Access does a pretty good job of handling the updates properly.

  7. #7
    Join Date
    Oct 2006
    Posts
    17
    Thanks guys i solved the problem. Much appreciated

Posting Permissions

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