I went to my large Encounters table and started adding fields. It was not
long before I reached the maximum, just as you predicted, and so I deleted
some of the new fields to make the database function again.
Well... that's starting 300 yards down the track.
When you're first setting up a database, start by...
*turning off the computer*. Go into a different room. Take a pad of
paper and a #2 pencil.
Identify the real-life *things*, *people*, and *events* - called
Entities - relevant to your application.
Then I created a new table called Shoulders and set up a number of fields
related to the various parts of the shoulder examination, eg
PalpationRightShoulder, PalpationLeftShoulder, AbductionRightShoulder,
AbductionLeftShoulder etc.
A Shoulder (if it's an entity at all which I very much doubt) has
properties: some shoulders are left shoulders, some shoulders are
right shoulders. I'd say that if you have a table of Shoulders at all,
you'll want a "side" property, which will have the value Left or
Right.
If you're treating a shoulder, you'll have a many to many relationship
between Shoulders and Treatments. To model a many to many relationship
you *don't* add new fields; you add a new *table* -
ShoulderTreatments. One row might have ShoulderID (referring to
patiend 3122's left shoulder), and TreatmentID 8 (palpation); the next
record might have ShoulderID 3122, TreatmentID 31 (manual reduction of
dislocation). "Fields are expensive, records are cheap" - tables
should grow down, not across.
I named the primary key ShoulderID, set the data
type for the primary key as number, and joined the Encounters table and the
Shoulders table by creating a one-to-one relationship between EncounterID and
ShoulderID. I populated the ShoulderID field with the existing EncounterID
data. I added the fields in the Shoulders table to the Data Entry query, and
then to the DataEntry form, which is based on that query. This allowed me to
add shoulder data to all existing records (over 4000 of them). In order to
get Access to accept shoulder data in a new record, I set the default for the
Shoulder ID text box to =EncounterID.
Again - you're storing data in fieldnames and tablenames. Neither
fieldnames nor tablenames are appropriate places to store data. You
store data IN FIELDS.
Rather than a table of Shoulders, you should have a table of
Treatments - with a field for the body part being treated, and a field
for the type of treatment. Again - GROW DOWN, not across.
Just as a side note, it is *NOT* necessary - nor even appropriate - to
link tables by using the defaultvalue property. Instead, use a Form
with a Subform; if an Encounter involves multiple Treatments, you
would have the mainform based on the Encounters table, and the subform
based on the Treatments table, with EncounterID as the master/child
link field. This will automatically keep the tables in synch.
I was finally successful in getting a second data entry form, DataEntry2, to
work in sync with the Data Entry form, so that both forms displayed the same
record. The key here was to create a macro triggered by the On Current event
in the Data Entry form. This macro contains the following WHERE condition:
[EncounterID] = [Forms]![Data Entry]![EncounterID]
I believe I can now add as many as 754 additional controls (minus the ones I
used to set up DataEntry2), and that the only limitation I face is a
reduction in speed as the number of controls increases.
I'm sure you can. And I'm afraid that by doing so you'll be digging
yourself deeper and deeper into a flawed design, unnecessarily.
John W. Vinson[MVP]