Aristillus
Registered User.
- Local time
- Today, 08:25
- Joined
- Nov 19, 2011
- Messages
- 15
Hi,
I'm hoping someone can help with a problem that I've been trying to solve for some time. It seems to me that my problem can't be that uncommon, and yet I can't find a solution anywhere.
I will simplify what I'm trying to do here for the sake of clarity. I have one table with around 30 fields. Each entry is a record of a quality check on an individual. I have created several queries and created various reports and a form in order to make data entry simple. So far so good.
Now, these quality checks are performed by different people. Lets say that 5 people all have a copy of the database (front and and back end) on their laptops. Now lets say each person records 2 quality checks. These have a primary key (autonumber) of 1 and 2 on each laptop.
The records have to be combined ie uploaded onto a central database. Obviously they can't just be added or I would have 5 entries with "1" as the PK and 5 entries with "2" as the PK. So I realised I needed to use an Append query but leaving off the PK field. This means that the master database will re-generate PKs as the records are appended. So lets say these 5 quality inspectors upload their 2 records to the main database. This now consists of 10 records with PKs of (say) 1 to 10.
Now, the quality inspectors need to update some data on each of their quality checks on their laptops. When they come to upload the amended records to the main database, the PKs no longer match up (ie quality Inspector number 2 has 2 records with PKs 1 & 2 but those very same records on the main database have PKs of 3 & 4).
After a lot of head scratching and googling, I decided that I could create a unique primary key calculated by using an identifier for each inspector and the autonumbered PK. That is to say, the 1st Inspector is given a ref of 123. This is his number and no-one elses. He inputs this when creating a new record and an autonumbered field creates a unique number for that record. I thought I could then multiply the inspector number by 1,000 and add the autonumber to create 123001 as a PK. The next Inspector will be given a ref of 124 and so he will have his first record as 124001.
I thought this was a good idea because (as long as no inspector inputs more than 1,000 quality checks) there will be no duplicates but each record will be unique and the have the same PK on the main database so can be updated.
however, I can't work out how to do this and the Access fraternity will not contemplate calculated PKs and would rather execute anyone who asks how to do this than answer the question. Hence I am stuck.
Any advice very gratefully received.
Sorry for the long post but wanted to try to explain fully what I need to achieve.
I'm hoping someone can help with a problem that I've been trying to solve for some time. It seems to me that my problem can't be that uncommon, and yet I can't find a solution anywhere.
I will simplify what I'm trying to do here for the sake of clarity. I have one table with around 30 fields. Each entry is a record of a quality check on an individual. I have created several queries and created various reports and a form in order to make data entry simple. So far so good.
Now, these quality checks are performed by different people. Lets say that 5 people all have a copy of the database (front and and back end) on their laptops. Now lets say each person records 2 quality checks. These have a primary key (autonumber) of 1 and 2 on each laptop.
The records have to be combined ie uploaded onto a central database. Obviously they can't just be added or I would have 5 entries with "1" as the PK and 5 entries with "2" as the PK. So I realised I needed to use an Append query but leaving off the PK field. This means that the master database will re-generate PKs as the records are appended. So lets say these 5 quality inspectors upload their 2 records to the main database. This now consists of 10 records with PKs of (say) 1 to 10.
Now, the quality inspectors need to update some data on each of their quality checks on their laptops. When they come to upload the amended records to the main database, the PKs no longer match up (ie quality Inspector number 2 has 2 records with PKs 1 & 2 but those very same records on the main database have PKs of 3 & 4).
After a lot of head scratching and googling, I decided that I could create a unique primary key calculated by using an identifier for each inspector and the autonumbered PK. That is to say, the 1st Inspector is given a ref of 123. This is his number and no-one elses. He inputs this when creating a new record and an autonumbered field creates a unique number for that record. I thought I could then multiply the inspector number by 1,000 and add the autonumber to create 123001 as a PK. The next Inspector will be given a ref of 124 and so he will have his first record as 124001.
I thought this was a good idea because (as long as no inspector inputs more than 1,000 quality checks) there will be no duplicates but each record will be unique and the have the same PK on the main database so can be updated.
however, I can't work out how to do this and the Access fraternity will not contemplate calculated PKs and would rather execute anyone who asks how to do this than answer the question. Hence I am stuck.
Any advice very gratefully received.
Sorry for the long post but wanted to try to explain fully what I need to achieve.