Results 1 to 5 of 5

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

  1. #1
    RehGnav is offline Novice
    Windows 10 Access 2016
    Join Date
    Dec 2019
    Posts
    2

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

    I'm still pretty newbie in Access but I was given a project to edit our access database to input a new name into the database so that, that name can be used to fill out forms. After adding a new record (the new user) inside the table with the names, I get the error message "you cannot add or change a record because a related record is required in table access" when filling out the form with that name.

    I have "enforce referential integrity" with both "cascade update related fields" and "cascade delete related records" checked. I assumed after having these checked, there shouldn't be any issues?



    Any help is appreciated!!

    To add-on, all of the other names in the table works fine when filling out the form, just the new name (record), doesn't work.

  2. #2
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    20,719
    It sounds like you've got referential integrity enforced on the "access" field in the names table. That would mean it can't be left blank, it needs to have a value that exists in the access table.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    RehGnav is offline Novice
    Windows 10 Access 2016
    Join Date
    Dec 2019
    Posts
    2
    Quote Originally Posted by pbaldy View Post
    It sounds like you've got referential integrity enforced on the "access" field in the names table. That would mean it can't be left blank, it needs to have a value that exists in the access table.
    So I should not have "referential integrity enforced" checked? And can you possibly give me an example of what you mean in your second sentence?

  4. #4
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    20,719
    Referential Integrity (RI) is fine when appropriate. I don't know what your tables contain. If I have an orders table and I only want orders entered for customers that exist in the customers table, I can enforce RI between the two tables. If I want to be able to leave the customer blank (perhaps a walk-up cash customer), I can't enforce RI (or I do but have a "cash" customer). The second sentence means that the customer field can't be left blank, it must contain a customer that exists in the customer table. If the customer tables contains 3 customers: ABC, DEF, & XYZ, those are the only valid entries in the customer field of the orders table.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    isladogs's Avatar
    isladogs is offline Very idle programmer
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    3,823
    Suggest you read my article explaining Relationships and Referential Integrity http://www.mendipdatasystems.co.uk/r...ps1/4594533224
    Colin (Mendip Data Systems) : Website, email
    If this has helped, please click the star button and leave a comment

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 4
    Last Post: 08-01-2019, 04:24 PM
  2. Replies: 17
    Last Post: 01-25-2018, 08:03 PM
  3. Replies: 6
    Last Post: 07-28-2016, 06:07 PM
  4. Replies: 15
    Last Post: 03-05-2015, 03:30 PM
  5. Replies: 40
    Last Post: 08-20-2013, 11:38 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Tech Forums: Microsoft Office Forums