Results 1 to 5 of 5
  1. #1
    sunnyday is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Dec 2014
    Posts
    45

    Unhappy Would let me add record

    Hi I have got a split database with backeend on network drive and front ends on usesr desktops..


    Everything was going fine until someone did something and now it wont allow any front ends to enter new records.. Queries as saved or entered earlier works fine its the front ends giving problem. I have tried compact and repair both on backend and my front end but it doe snot help.
    the error message is "You cannot change or add a record as there is no related record in table...
    Although the relationship seems just fine as earlier it was designed..

    Please help

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    When you have records in a relationship eg Parent--->Child where 1 Parent may have 0,1 or Many Child records.

    You can NOT add a Child record if there is no Parent record. In other words, you must add the Parent, and then add the related child record(s).

    The message is quite clear: You cannot change or add a record as there is no related record in table

  3. #3
    JamesDeckert is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Jul 2015
    Location
    Salina, KS
    Posts
    262
    What Orange said, if referential integrity is set for the relationship. In your case it sounds like it has been.
    If referential integrity is not set, then child records can be added without a parent.

  4. #4
    sunnyday is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Dec 2014
    Posts
    45
    Hmm, refrential integrity was set initially between th etwo tables . An autonumber which was a primary key in parenttable was connected to primary autonumber in child table as one to one relationship . Corruption happened when in the forms a field which was a number but appeared as text to people .. someone tried to manually type in that drop down box. And then the forms would not let any record to be added in any of the front end. On compact & repair DB,What happened later to that child table was that it lost its primary key which was the autonumber.quite strange because people had been using the front ends and entering data.
    WAs because that while someone was using front end, another user was attempting to edit something on back end?

  5. #5
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    Post a copy of your database.
    I think there is an issue with this statement, if I have understood it.

    An autonumber which was a primary key in parent table was connected to primary autonumber in child table as one to one relationship .
    If you have an autonumber PK in Parent table, and an autonumber PK in the child --AND you have related these autonumbers--that is WRONG.

    Your Parent table would have fields such as
    ParentID PK autonumber
    ParentFName
    ParentLName
    ....

    The child table along this line

    ChildID PK autonumber
    ChildFName
    ChildLName
    ChildDOB
    ParentID_FK (long) <-----Foreign key which is used to establish relationship between Parent and Child tables
    .....

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

Similar Threads

  1. Replies: 3
    Last Post: 03-09-2013, 10:39 AM
  2. Replies: 2
    Last Post: 12-21-2012, 01:57 PM
  3. Replies: 4
    Last Post: 12-14-2012, 06:33 PM
  4. Replies: 3
    Last Post: 10-19-2012, 04:30 PM
  5. Replies: 14
    Last Post: 05-25-2012, 02:40 AM

Posting Permissions

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