T
Tom
I have a 3-tier One-To-Many table structure.
tblOrganization:
OrganizationID (Autonumber)
Organization (Text)
tblBranch:
BranchID (Autonumber)
OrganizationIDfk (Number)
Branch (Text)
tblSubBranch:
SubBranchID (Autonumber)
BranchIDfk (Number)
Subbranch(Text)
Currently, all Autonumber are also set as the primary key.
- The data entry is done via the mainform (frmOrganization)
- which then has a subform (sfrmBranch)
- which then has also a subform (sfrmSubBranch).
The data of the subforms is being displayed in "datasheet" view.
Here, now is the problem I'm trying to overcome:
- Currently, I could add the same Branch multiple times under the same
Organization (same record). I don't want this! (It would be okay though
to repeat the same sub entity on another organization record).
Here's what I have tried (but doesn't work for me):
- In tblBranch, used a composite key of of 3 fields (BranchID,
OrganizationIDfk,
and Branch).
- Now, however, I cannot create the relationship in the ERD view. An dialog
box pops up that indicates that there is no unique index.
Is there a way to keep to table structure which, howewever, DOES NOT allow
to
- enter multiple duplicate entries of "Branch" under "Organization"
- enter multiple duplicate entries of "Subbranch" under "Branch"
Thanks,
Tom
tblOrganization:
OrganizationID (Autonumber)
Organization (Text)
tblBranch:
BranchID (Autonumber)
OrganizationIDfk (Number)
Branch (Text)
tblSubBranch:
SubBranchID (Autonumber)
BranchIDfk (Number)
Subbranch(Text)
Currently, all Autonumber are also set as the primary key.
- The data entry is done via the mainform (frmOrganization)
- which then has a subform (sfrmBranch)
- which then has also a subform (sfrmSubBranch).
The data of the subforms is being displayed in "datasheet" view.
Here, now is the problem I'm trying to overcome:
- Currently, I could add the same Branch multiple times under the same
Organization (same record). I don't want this! (It would be okay though
to repeat the same sub entity on another organization record).
Here's what I have tried (but doesn't work for me):
- In tblBranch, used a composite key of of 3 fields (BranchID,
OrganizationIDfk,
and Branch).
- Now, however, I cannot create the relationship in the ERD view. An dialog
box pops up that indicates that there is no unique index.
Is there a way to keep to table structure which, howewever, DOES NOT allow
to
- enter multiple duplicate entries of "Branch" under "Organization"
- enter multiple duplicate entries of "Subbranch" under "Branch"
Thanks,
Tom