regarding main and sub-form relationships

T

Ted

the ingredients of my situation consist in three tables

a) Audit Reports (parent): PK = "IRB Number"

b) Evaluations: PK = "IRB Number" and "Date of Audit"

c) Patients: PK = "IRB Number", "MedRecNum" and "Date of Audit" (where
medrecnum means patient's medical record number

my relationships have a one to many between 'a' and 'b' linked via "IRB
Number" and a one to many between 'a' and 'c' linked via "IRB Number" as well.

i have created a form called "Audit Reports" having the source table 'a'
onto which i slapped two sub-forms called "Evaluations" and "Patients" having
the source tables 'b' and 'c' respectively.

does this seem 'OK'?

it doesn't seem to be working quite yet---by which i mean when i add data
into all three forms, close it and then re-enter, the 'Audit Reports' form
opens in add record mode and won't let me see what's already been entered?
this seems definitely screwy and i've spent too much time going around in
circles trying to puzzle it out so i'm hoping the answer's 'obvious' to
someone willing to share their expertise w/ me.

IRB number refers to a medical experiment which can have lots of patients on
it (each one being uniqeuly identified by a hospital med record number; sort
of like the social security number) whose date are assembled into folders
(having their med rec number) over time (possibly lasting years). during the
life of the experiment auditors will pop up from time to time and randomly
select med record numbers (folders) to pour through. when they do corresponds
with the Date of Audit.

so records in the Audit Report table uniquely identify each medical
experiment (IRB number).

records in the Evaluation table uniquely identify the Dates of Audit
performed for each IRB number.

records in the Patients table uniquely identify each patient (med record
number) whose folder was audited on that particular Date of Audit in that
particular med experiment (IRB number).


-ted
 
P

Pat Hartman

The primary key for the patients table doesn't look right. The PK for
patients should be only the MedRecNum. Since over time, the same patient
might participate in more than one IRB, you need a relation table that
contains just MedRecNum and IRB as the multi-field primary key. Date of
Audit does not belong in this table nor in the patients table.

When working with 1-many and many-many relationships, you should use main
and subforms. The master/child links need to be properly set and Access
will then populate the foreign keys in the subform records.
 
T

Ted

hi, so you're saying this is one of those instances where we have a many-many
relationship? this marks something of a turningpoint for this writer, then...

could you be a bit more basic, pat. because of the above description. i have
worked with 1-many relationships in many instances in my mdbs and in the
context of parent/child linked form/sub-form. here things are different it
seems.

to get this to work at the interface level, i thought the user would like to
see a single screen per IRB. atop the screen there would be the data entry
fields/controls which addressed the identification of "static" information
(the IRB Number and sundry other controls that apply to the description of
the medical study and remain constant). appearing below, i envisaged a
datasheet sub-form view of a table having a link with the parent via the IRB
number (with PK comprising IRB and Date of Audit) which would enable user to
record information relevant to the auditors evaluation of an audit that
happened at the Dte of Aud. just below the "Evaluations" datasheet, i
envisaged the 2nd and final sub-form (datasheet view of a table having PKs
consisting of IRB, Dte of Aud and Medrecnum) which would link with the parent
via IRB number and would describe any issues arising at the patient level on
that audit (e.g. say that on an audit conducted on a certain date for a
certain IRB number a certain patient's informed consenst form could not be
identified).

my issue is bridging the above interface with the points you're raising. can
you fill in the voids?

best,

-ted
 
P

Pat Hartman

The patient table would normally contain some information about the patient.
That information has no relationship with his participation in a study.
That is why I suggested removing the other two fields from the patient
table's primary key. You wouldn't want different names for the patient or
different addresses, etc. If a patient can participate in one and only one
study EVER, then you have a 1-many relationship and you can store IRB as a
foreign key in the patient table. However, if the patient may at some time
in the future, participate in a different IRB, then there is a many-many
relationship and you would need a relation table to accommodate that
structure.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top