Results 1 to 8 of 8
  1. #1
    Join Date
    Nov 2012
    Posts
    6

    Related Record Required

    I am designing a database with three tables.



    The main table - ALL - has records for all participants in a study. The two subtables tables - Employed and Not_Working - should have records only for employed and not working participants respectively, and thus are each a subset of the records in the main table.

    When I have designed databases along these lines before, I was able to create relationships between the All table and the two partial-tables by choosing the join type "Include ALL records from 'Emp' and only those records from 'All' where the joined fields are equal," and this worked perfectly well. I could enter data into the All table even where there was no related record in the Emp table -- a related record was only created after data was entered in the Emp table.

    This time, however, I keep getting the error message that a related record is required -- specifically in the Emp table, though there are two subtables with relationships to the main table. Have I chosen the wrong join type? I have also tried chancing the join type and it doesn't seem to help.

    Frustratingly, I can create records in either subtable without a record in the main table (which shouldn't be allowed), so obviously I have something set backwards here.

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    Is the option Enforce Referential Integrity checked for the join in Relationships builder?

    Want to provide db for analysis? Follow instructions at bottom of my post.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    Join Date
    Nov 2012
    Posts
    6
    Quote Originally Posted by June7 View Post
    Is the option Enforce Referential Integrity checked for the join in Relationships builder?
    Yes, I have checked the Enforce Referential Integrity option.

    I'm sorry, I can't provide the database as it is confidential

  4. #4
    Join Date
    Nov 2012
    Posts
    6
    I just noticed - of course, you said to remove confidential data. I'll try that for posting.

  5. #5
    Join Date
    Nov 2012
    Posts
    6
    T3_Tel_TABLES_testing.mdb

    Here is the database in question.

  6. #6
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    If Enforce Ref Int is not checked then records can be entered anywhere.

    I deleted the joins and recreated by dragging from the All table to each of the partial tables and select Enforce Ref Int. Now records are required in the All table before records in partial table allowed. Drag in the other direction and the reverse is established.

    You are linking these tables on primary keys. This is a one-to-one relationship and structure is essentially a big flat file and your data does not appear to be normalized. The proliferation of similar named fields is an indicator of that. Will every field have value for every record?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  7. #7
    Join Date
    Nov 2012
    Posts
    6
    I will try that solution and report back, thank you.

    Yes, every record does have a value in every field in the all table (if only a code that represents "no entry"). It is a scientific study; we are required to record both null results and also need to export our data to statistical analysis software that requires one flat table for everything. The names are just codes for the questions (eg 21a, 21b, 21c). We are only using access to create user-friendly data-entry forms for our students.

  8. #8
    Join Date
    Nov 2012
    Posts
    6
    That worked - thank you.

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

Similar Threads

  1. Replies: 8
    Last Post: 09-20-2012, 12:13 PM
  2. Replies: 3
    Last Post: 08-21-2012, 01:10 PM
  3. Replies: 7
    Last Post: 07-02-2012, 10:50 PM
  4. ...related record required...
    By degras in forum Forms
    Replies: 11
    Last Post: 11-03-2011, 12:20 PM
  5. Add Record based on related value
    By top1hat19 in forum Access
    Replies: 0
    Last Post: 03-08-2011, 12:45 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
  •  
Other Forums: Microsoft Office Forums