|
Prev: IF HELP
Next: Database template
From: John W. Vinson on 5 Jul 2008 21:16 On Thu, 3 Jul 2008 13:57:00 -0700, Ben Bamford <BenBamford(a)discussions.microsoft.com> wrote: >I have a Parent Table "Employee" with PK "EmpID" and 3 other fields in that >table. >I have a Related Table "EmployeeInfo" with PK "EmpID" and 1 other field >("Salary")in that table. >I related "tblEmployee" to "tblEmployeeInfo", enforcing referential >integrety, and cascade update and cascade delete. >I entered 4 employee records in "tbl Employee" (all fields). >The "EmpID" values in "tblEmployee" DO NOT appear in the "EmpID" field of >"tblEmployeeInfo". Why not? Because creating a relationship does not (and emphatically SHOULD not!) automagically create a new record in the child table. A relationship *prevents* the addition of a record with a nonexistant EmpID, should you try to create such a record. It does not cause a new record to be created. A one to one relationship is jargon shorthand for a One to (zero or one) relationship; it means that if there is a record in tblEmployeeInfo then it must use a value of EmpID which exists in tblEmployee, but there might not be any records in the table for that ID, or for that matter, there might not be any records at all. -- John W. Vinson [MVP] |