Relationships and lookup tables.

B

Ben

I understand your point, however, there might be occasions when such 1:1
relationships occur for privacy reasons (splitting "private" information into
a separate table) and providing a link to the "public" table. In any event,
whether 1:1 or 1:M, my key frustration seems to be that I do not see ALL of
the same "EmpID" values in both "tblEmployees" and "tblEmployeeInfo" (whether
or not fields other than "EmpID" have any values entered -- in the
"tblEmployeeInfo").

Maybe it's this idea I have that there should at least be a "placeholder" in
evidence in the subordinate table to ensure that one can visually verify the
match between EmpID values in the tblEmployees and EmpID values in the
tblEmpInformation.

As to your comment about the main form and subform, I get exactly what I
expect when I navigate through the records in the main form (I see ALL EmpID
values in both tables, even if additional field values have not been entered
into the subform or subordinate table).

So, I am still left with my issue, but I do thank you for the resource link.
 
J

John W. Vinson

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top