Results 1 to 7 of 7
  1. #1
    DSL70 is offline Novice
    Windows Vista Access 2010 64bit
    Join Date
    May 2013
    Posts
    4

    Newbie with "violates referential integrity rules"

    I am hoping someone can help me out - I am new to access and I am trying to set a relationship between two tables, with the data types the same but keeps coming up with violates referential integrity rules....and I simply do not understand what this means, and how to solve it...

    I have attached the file for reference.
    Attached Files Attached Files

  2. #2
    Beetle is offline Unrelatable
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    Camp Swampy (Denver, CO)
    Posts
    207
    OK, so which fields are the ones on which you were trying to establish a relationship?

  3. #3
    DSL70 is offline Novice
    Windows Vista Access 2010 64bit
    Join Date
    May 2013
    Posts
    4
    Sorry - The Job ID and ID.

  4. #4
    Beetle is offline Unrelatable
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    Camp Swampy (Denver, CO)
    Posts
    207
    You can't establish the relationship on two primary key fields. If tblJobDetail is intended to be the child table then you need to add an additional field (named JobID or JobIDFK, something like that) to tblJobDetail. Make it a Number data type and then establish your relationship between JobID in tblJobOrder and the new field in tblJobDetails.

  5. #5
    DSL70 is offline Novice
    Windows Vista Access 2010 64bit
    Join Date
    May 2013
    Posts
    4
    So do I make my new JobIDFK field the primary field? If I do Access advises "index or primary key cannot contain a Null value"... If I made this an Autonumber, would that help?

  6. #6
    Beetle is offline Unrelatable
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    Camp Swampy (Denver, CO)
    Posts
    207

    Re: Newbie with "violates referential integrity rules"

    No. It's a foreign key, not a primary key. Leave the existing PK field in tblJobDetail unchanged.

  7. #7
    DSL70 is offline Novice
    Windows Vista Access 2010 64bit
    Join Date
    May 2013
    Posts
    4
    Thank you!

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

Similar Threads

  1. Replies: 4
    Last Post: 01-03-2013, 03:50 PM
  2. Replies: 3
    Last Post: 12-20-2011, 08:41 AM
  3. Referential integrity rules
    By mhart in forum Database Design
    Replies: 2
    Last Post: 07-28-2011, 04:43 PM
  4. Referential Integrity
    By Desstro in forum Database Design
    Replies: 4
    Last Post: 06-13-2010, 01:29 PM
  5. Referential Integrity
    By jbarrum in forum Access
    Replies: 5
    Last Post: 01-14-2010, 09:04 AM

Tags for this Thread

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