I have been searching your forum and found a similar post from 2006 about setting a calculated field as a primary key; however, I could not find out how to actually do this.
I am aware that most advise against doing this but I would really like to try for myself and if it fails it's ok because my database is still at the very early stage and fairly easy to re-do if necessary.
At present I only need to use the tables to quickly reference drawings for a construction company. There are 3 tables in total
Table 1 is the Contract Table which has 2 fields - Contract No (primary key) and Contract Name
Table 2 is the Drawings Table which is linked to the contracts table by the contract number. Fields in this table include the drawing number, drawing title, 1st issue date and revision letter or number
Table 3 is the revisions table which notes any amendments to the original drawing issued
The contract number in the contracts table will ALWAYS be unique. It is not an autonumber but an 8-digit number that is created by another program and used for all contract documents.
The problem I have is in table 2. The drawing numbers will be unique within a particular contract but may not be unique between contracts e.g. Contract No 20130101 can only have one drawing number 101; however another contract could also have a drawing 101.
I created a unique drawing ID by combining the contract number with the drawing number e.g. 20130101-101 (this will always be unique); however, I can't find a way of setting this field as the primary key as the primary key button is greyed out.
Is it possible to do this and if yes could you please tell me how.
I am aware that most advise against doing this but I would really like to try for myself and if it fails it's ok because my database is still at the very early stage and fairly easy to re-do if necessary.
At present I only need to use the tables to quickly reference drawings for a construction company. There are 3 tables in total
Table 1 is the Contract Table which has 2 fields - Contract No (primary key) and Contract Name
Table 2 is the Drawings Table which is linked to the contracts table by the contract number. Fields in this table include the drawing number, drawing title, 1st issue date and revision letter or number
Table 3 is the revisions table which notes any amendments to the original drawing issued
The contract number in the contracts table will ALWAYS be unique. It is not an autonumber but an 8-digit number that is created by another program and used for all contract documents.
The problem I have is in table 2. The drawing numbers will be unique within a particular contract but may not be unique between contracts e.g. Contract No 20130101 can only have one drawing number 101; however another contract could also have a drawing 101.
I created a unique drawing ID by combining the contract number with the drawing number e.g. 20130101-101 (this will always be unique); however, I can't find a way of setting this field as the primary key as the primary key button is greyed out.
Is it possible to do this and if yes could you please tell me how.
Comment