Results 1 to 5 of 5
  1. #1
    Join Date
    Apr 2007
    Posts
    16

    Unanswered: Relationship Problem in Access

    Hi guys, im a newbie to the forum and to databases/Access really!

    Anyway hoping you guys don't laugh and can help me

    I've got 3 tables, below.

    Table1

    U_ID - (Primary Key)
    U_Name
    U_Password
    Email

    Table 2

    Fault_ID (Primary Key)
    Fault_Description
    Date_Reported
    Date_Resolved
    User_ID (Foreign Key ??)
    Assigned_Technician_ID (Foreign Key???)
    Status

    Table 3

    Technician ID (Primary Key)
    Forename
    Surname
    Contact No
    Email Address


    I want to link them so you can see which user has which fault and which fault is being dealt with by which technician.

    However if i try and add data to say Table2 it says "You cannot add or change a record because a related record is required in table 'Table1'."

    HELP!

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    generally speaking its better to create the realtionships prior to entering the data


    however all the message is telling you is that you are trying to get a relationship, there is data in table 2 which is not defined in table 1. so to clear the problem either delete the offending data, OR change it or add it to table 1

    there are a couple of query's in the query wizard which may help you identify what data is causing the problem
    I'd rather be riding on the Tiger 800 or the Norton

  3. #3
    Join Date
    Apr 2007
    Posts
    16
    So looking at table and relationship struture there is nothing logically wrong?

  4. #4
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    I dont know, as you havent told us what your data types are
    to create a realtionship the datatypes must be the same. BTW autogenerated in Access/JET Speak is the same as long

    the error message you quote indicates that that isnt a problem... Access/JET could create the link, but existing data conflicts stop it doing so
    I'd rather be riding on the Tiger 800 or the Norton

  5. #5
    Join Date
    Nov 2002
    Posts
    272
    Quote Originally Posted by Rich2701
    However if i try and add data to say Table2 it says "You cannot add or change a record because a related record is required in table 'Table1'."
    It looks like you try to insert a value into Table2.User_ID for which there is no corresponding record in Table1.
    You need to add a user to Table1 before you can reference him in Table2.

Posting Permissions

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