S
Steve
Greetings:
I am creating a database to track test outcomes. The simplified table
structure appears as follows:
Table Structure 1
tblTest tblSubTest
PK idsTestID PK idsSubTestID
dtmTestDate FK intTestID
chrsubTest
intSubTestResult
These tables are joined in a 1:many relationship using the primary key
"idsTestID" and foreign key "intTestID". Each test is associated with one or
more subTest(s) and subTest results. This all works fine until we get to the
data entry. Each test can potentially be associated with numerous subTests
and subTest results. Having the user have to individually choose and fill in
each subTest from a long drop down list of potential subTests and enter the
subtest result is cumbersome at best.
Alternatively, I could "hard wire" the subTests into the Test table as
follows:
Table Structure 2
tblTest
pk idsTestID
dtmTestDate
intSubTest1
intSubTest2
intSubTest3 (and so on)
This format simplifies data entry because I can design a form that has
subTests bound directly to its own datafield. The user can tab quickly down a
series of defined controls and enter the subTest results. But this approach
is problematic because not every subtest is used during each test, some will
be rarely used. To make matters worse each series of subTests can be repeated
under different conditions. This would create the potential for numerous
blank datafields and inefficient storage. The question therefore is how to
keep the original table structure but provide the user with a convenient data
entry platform.
The solution I am proposing is the use of a temporary table that would
resemble table structure 2 above and have a field for each of the subTests.
This would be bound to a data entry form where each subTests would be present
as its own control on the dataentry form. When the user is done some sort of
"finalize" button would be clicked and each of the data fields in the
temporary table would be saved as a separate record in tblSubTest using the
desired table structure structure 1 shown above and the tempTable would be
cleared.
Does this seem like a good solution to the problem? Does anyone have a
different solution? Does anyone have an example of the coding used to
accomplish what is being proposed (i.e., moving the data from the temp table
into tblSubTest)?
Thanks for any and all help.
I am creating a database to track test outcomes. The simplified table
structure appears as follows:
Table Structure 1
tblTest tblSubTest
PK idsTestID PK idsSubTestID
dtmTestDate FK intTestID
chrsubTest
intSubTestResult
These tables are joined in a 1:many relationship using the primary key
"idsTestID" and foreign key "intTestID". Each test is associated with one or
more subTest(s) and subTest results. This all works fine until we get to the
data entry. Each test can potentially be associated with numerous subTests
and subTest results. Having the user have to individually choose and fill in
each subTest from a long drop down list of potential subTests and enter the
subtest result is cumbersome at best.
Alternatively, I could "hard wire" the subTests into the Test table as
follows:
Table Structure 2
tblTest
pk idsTestID
dtmTestDate
intSubTest1
intSubTest2
intSubTest3 (and so on)
This format simplifies data entry because I can design a form that has
subTests bound directly to its own datafield. The user can tab quickly down a
series of defined controls and enter the subTest results. But this approach
is problematic because not every subtest is used during each test, some will
be rarely used. To make matters worse each series of subTests can be repeated
under different conditions. This would create the potential for numerous
blank datafields and inefficient storage. The question therefore is how to
keep the original table structure but provide the user with a convenient data
entry platform.
The solution I am proposing is the use of a temporary table that would
resemble table structure 2 above and have a field for each of the subTests.
This would be bound to a data entry form where each subTests would be present
as its own control on the dataentry form. When the user is done some sort of
"finalize" button would be clicked and each of the data fields in the
temporary table would be saved as a separate record in tblSubTest using the
desired table structure structure 1 shown above and the tempTable would be
cleared.
Does this seem like a good solution to the problem? Does anyone have a
different solution? Does anyone have an example of the coding used to
accomplish what is being proposed (i.e., moving the data from the temp table
into tblSubTest)?
Thanks for any and all help.