Results 1 to 6 of 6
  1. #1
    Join Date
    Aug 2014
    Posts
    3

    Unanswered: You Cannot Add or Change a Record

    Every time I go to input data into my Access file I keep getting an error that reads "You cannot add or change a record because a related record is required in table 'Resident'." I tried reviewing the relationship but cannot seem to figure it out.
    Attached Files Attached Files

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    So just guessing table resident defines the parent key of the row you want to add or edit in the 'child' table. For that action to succeed the the value you want to insert into the child tables (as a foreign key) must exist in the 'parent' table

    feristance. If you had a table that recorded when a user logs onto a system, you.d probably have a table for users. The primary key in the users table (say userid) would be the foreign key in user logons. A user has on id but a user may have many log on entries in the user logon table.
    Last edited by Missinglinq; 09-22-14 at 14:59.
    I'd rather be riding on the Tiger 800 or the Norton

  3. #3
    Join Date
    Aug 2014
    Posts
    3
    The 'Resident' table is where the information is coming from to fill in the 'Task' form. For instance, if resident 1 needs to have a leak fixed, in the 'Task' table, the information from resident 1 will be pulled from the 'Resident' table so we know who and where the maintenance order needs to be completed at. If that makes sense.

  4. #4
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    so where are you getting the value for the resident (the primary key for resident) so you can add a row to tasks?
    I'd rather be riding on the Tiger 800 or the Norton

  5. #5
    Join Date
    Aug 2014
    Posts
    3
    I'm not sure what you are asking. I have attached the file if that helps.
    Attached Files Attached Files

  6. #6
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    You have defined a one to one relationship between resident and task. In order for you to insert a row into tasks you must have a resident id which all ready exists in residents. I dont see where your form design supports that
    I'd rather be riding on the Tiger 800 or the Norton

Posting Permissions

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