I am trying to set up a database of communication cable test project results.
The database simply stores client data and test results for individual test projects.
To ask my question I will not confuse things with detail but will focus on what I am having problems with.
In the database there is a TEST PROJECT that always has results from tests in a "PRINCIPLE BOX", and that "PRINCIPLE BOX" will have circuits, and it may also connect to other "SUB BOXES" that have test results from circuits in these boxes.
I am using three tables to hold the test results for each test project
First table has data about the PRINCIPLE box
It has a unique project ID field - (the field that I want to be the unique and primary key)
and many more test result fields
Second table for SUB boxes connected from the PRINICIPLE box
the SUB box has a unique sub box ID field - (the field that I want to be the unique and primary key)
and date, location and description fields
A third table for CIRCUITS within the SUB boxes
with one unique circuit ID field - (the field that I want to be the unique and primary key)
and many more test result fields
I thought this would be easy-peasy to relate in that the PRINCIPLE box project ID primary key would be a one-to-many to the SUB box ID field which is a one to many to the circuit ID field in the circuits table.
But I find that Access will not allow a one to many field if there is a primary key on both ends of the relationship.
I fixed this by creating a field called "copy of sub box ID field" in the sub box table, made the required one-to-many relationship from the principle box table to sub box ID field, and then made the copy field the primary key and made the one-to-many from "copy of sub box ID field" to the circuit ID field and then made a "copy of circuits ID field" in the circuits table and made this the primary key.
By this route I was able to complete the required logical relationships.
Then I realised I would have to do some automatic setup that made sure the "copy of" fields were always kept synchronised with the primary key fields.
AND THEN I realised that this approach was completly stupid and I was obviously doing it all wrong.
So what am I doing wrong and how should I do this?
Apologies for long drawn out question but I think you will get the drift.
Any suggestions gratefully received.
Regards