Link to home
Start Free TrialLog in
Avatar of James Coats
James CoatsFlag for United States of America

asked on

MS Access: How to make Parent / Child table relationships

I have been trying to make the following parent child table relationship but can't seem to make it work.

The following table: "tblTools" is the parent, table "tblInspections" is the first child table "tblDimensionVerification" is the second child.

Can someone please help me out with this I keep getting relationship type errors and no index found errors when I try to put foreign key in I don't understand how to make this relationship.


Measuring-Instruments-4-29-11Rev.mdb
Avatar of Rey Obrero (Capricorn1)
Rey Obrero (Capricorn1)
Flag of United States of America image

did you create a Primary Key (PK) in tblTools. This PK will be the Foreign Key (FK) in the child tables
in table tblInspections, you don't need the DimensionPK field
in table tblDimensionVerification, you don't need the Tool_Pk field

you create the relation between tblInspections and tblDimensionVerification using the  InspectionPK field

Avatar of James Coats

ASKER

TheHiTechCoach,

Each tool can have many inspection results in the table tblDimensionVerification and many inspections in table tblInspections so I see your point they should be many to one. I don't see any changes in the file.

Capricorn1,

I made changes to the table relationships is this what you mean?? I have attempted to add a record to table tblDimensionVerification but I get an error stating that I can't put in a new record because I have to have a related tool in table tblTools.

see the file.


Measuring-Instruments-4-29-11Rev.mdb
ASKER CERTIFIED SOLUTION
Avatar of Rey Obrero (Capricorn1)
Rey Obrero (Capricorn1)
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
<I have attempted to add a record to table tblDimensionVerification but I get an error stating that I can't put in a new record because I have to have a related tool in table tblTools.>

this is caused by the relationship that you created with referential integrity.
* you can not create a child record without a parent record.

see Referential Integrity from this link for more info

Defining relationships between tables in a Microsoft Access database
http://support.microsoft.com/?kbid=304466
Thank you very much!!