L
Liverlass3981
I am working on a database which holds details of clinical studies. The main
table holds the main data and is the ‘one’ of the relationship with other
tables. This table, called ‘Study details’ has a primary key/field called
‘StudyRefNo’. So when I add a new record, I give it a number, normally the
next number after the previous record, so I have to look at what the last
record was, e.g if it was 6, I would type in 7 for the new record.
The primary key, StudyRefNo from the table Study details is linked to the
primary key fields in ‘many’ relationship tables. For example, I have a
table, ‘Project funding grants’ to hold the funding details of the studies
and the records here are also identified as ‘StudyRefNo’, with the same
format too as the primary key in Study details table. One study can have many
funding grant records.
My problem is that having already put data into the tables, I would have
preferred to have had the StudyRefNo in the Study details table as an
autonumber – to save me manually typing in a number and making sure the
number came after the previous record number (1, 2, 3, 4……). However I do not
know how to get round this problem because the primary keys in the ‘many’
tables have to be the same format (and name) as the primary field in my Study
details (‘One’) table, in order to identify each record. The StudyRefNo
fields in the many tables cannot be autonumbers also because they must be
already entered into the primary table first. So how can I make the
StudyRefNo an autonumber without changing the StudyRefNo’s in the ‘many’
tables?
I don’t want to lose the data already entered if I make changes, but before
I do attempt to do anything, I would be very grateful if someone could give
me some easy to follow, step by step instructions as to how to go about the
above. Hope I’ve made sense! Thanks. Liz.
table holds the main data and is the ‘one’ of the relationship with other
tables. This table, called ‘Study details’ has a primary key/field called
‘StudyRefNo’. So when I add a new record, I give it a number, normally the
next number after the previous record, so I have to look at what the last
record was, e.g if it was 6, I would type in 7 for the new record.
The primary key, StudyRefNo from the table Study details is linked to the
primary key fields in ‘many’ relationship tables. For example, I have a
table, ‘Project funding grants’ to hold the funding details of the studies
and the records here are also identified as ‘StudyRefNo’, with the same
format too as the primary key in Study details table. One study can have many
funding grant records.
My problem is that having already put data into the tables, I would have
preferred to have had the StudyRefNo in the Study details table as an
autonumber – to save me manually typing in a number and making sure the
number came after the previous record number (1, 2, 3, 4……). However I do not
know how to get round this problem because the primary keys in the ‘many’
tables have to be the same format (and name) as the primary field in my Study
details (‘One’) table, in order to identify each record. The StudyRefNo
fields in the many tables cannot be autonumbers also because they must be
already entered into the primary table first. So how can I make the
StudyRefNo an autonumber without changing the StudyRefNo’s in the ‘many’
tables?
I don’t want to lose the data already entered if I make changes, but before
I do attempt to do anything, I would be very grateful if someone could give
me some easy to follow, step by step instructions as to how to go about the
above. Hope I’ve made sense! Thanks. Liz.