J
JohnCall
I would appreciate somebody's help. I've setup a simple database with
three tables. Workers, WorkerShift, and Shift tables. I'm having
trouble because it is possible for the data-entry personel to input
duplicate LastName, FirstName values. For example, my database allows
the creation of a duplicate MARK SMITH. I do not want this to happen.
I do want to have multiple SMITHs, and multiple MARKs, but not multiple
MARK SMITHs. Any suggestions? Here is my table layout...
Worker fields:
WorkerID - Primary Key (autoIncrement)
LastName - Text
FirstName - Text
Gender - Text (Lookup)
PhoneNumber - Text (Input Masked)
WorkerShift fields:
WorkerID - Foreign Key(Worker) - Composite Primary Key
ShiftID - Foreign Key(Shift) - Composite Primary Key
Shift fields:
ShiftID - Priimary Key (autoIncrement)
Description - Text
I'm satisfied with the table / relationship setup. One worker can work
many shifts, and one shift may be staffed by many workers. It is not
possible for one worker to be assigned the same shift twice (due to the
composite primary key on the WorkerShift table). This is what I want.
Thank you,
John
three tables. Workers, WorkerShift, and Shift tables. I'm having
trouble because it is possible for the data-entry personel to input
duplicate LastName, FirstName values. For example, my database allows
the creation of a duplicate MARK SMITH. I do not want this to happen.
I do want to have multiple SMITHs, and multiple MARKs, but not multiple
MARK SMITHs. Any suggestions? Here is my table layout...
Worker fields:
WorkerID - Primary Key (autoIncrement)
LastName - Text
FirstName - Text
Gender - Text (Lookup)
PhoneNumber - Text (Input Masked)
WorkerShift fields:
WorkerID - Foreign Key(Worker) - Composite Primary Key
ShiftID - Foreign Key(Shift) - Composite Primary Key
Shift fields:
ShiftID - Priimary Key (autoIncrement)
Description - Text
I'm satisfied with the table / relationship setup. One worker can work
many shifts, and one shift may be staffed by many workers. It is not
possible for one worker to be assigned the same shift twice (due to the
composite primary key on the WorkerShift table). This is what I want.
Thank you,
John