I'll start working my way through, adding in comments (see below)...
oldblindpew said:
Thanks for reply.
Insurance certificates generally appear as a fairly standardized form,
known
as the Acord form. To the user, this certificate looks like one entity,
with
all its fields belonging in one table, but I have been warned over and
over
that Access cannot handle this kind of approach.
I suspect it isn't so much that Access cannot handle a "wide" table as it is
making proper use of the tool. Access is a relational database, and its
features/functions are optimized for well-normalized data. An analogy I'm
fond of using is that you absolutely can drive nails with a chainsaw, but
that doesn't mean it's the proper tool or a good idea!
(I still don't understand
why it is better to store a reference to a table containing a value,
rather
than just storing the value itself. It seems we are using three fields
and
two tables to do what could be done by one field in one table. And if the
same value appears in different records, so what? Computers are supposed
to
have plenty of muscle for this sort of thing).
Let's talk about person name ... one user enters "John Smith", another "John
J.J. Smith", another "J. Smith" and another "J.J.J. Smith" ... and they all
refer to the same human. And then John has his name legally changed to Jim.
If you "store the value itself" in a table, you have little chance of
connecting the dots and knowing those 4 (wait, 5!) people are all the same
person. If you store John once in a Person table, with a PersonID field,
then use the PersonID field in your 'other' table, you save the user data
entry time (just pick John from the combobox), reduce the risk of having 5
entries that are all the same person, and make updating John's name to Jim
quite simple ... go to the lookup table and change it once!
Anyway, each Firm for which we require insurance will have zero, one or
more
Certificates, and each Certificate describes one or more Policies.
Therefore
we need tables for Firms, Certificates, and Policies, with one-to-many
relationships.
FIRMS
PK IdFirm
Firm fields...
CERTS
PK IdCert
FK IdFirm
Cert fields...
POLICIES
PK IdPolicy
FK IdCert
Policy fields...
The Cert fields and Policy fields seem to fall into two categories. For
lack of better terms I will refer to them as the Definite and the
Indefinite.
Definite Cert Fields:
FK ProducerCode (Id for the insurance agency that produces the certifcate)
Cert Date (date certificate was produced or printed)
FK CertHolderCode (Id for the firm holding the certificate, which should
be
us)
Indefinite Cert Fields:
NOCDays (the number of days Notice of Cancellation)
NOCChange (do we also receive Notice of Material Change in coverage?)
NOCStrikeEndeav (are the words "Endeavor to" stricken from the NOC?)
NOCStrikeFailure (is the Failure clause stricken from the NOC?)
Future Fields... (unknown)
The Definite Cert fields unquestionably go in the Cert table, but the
Indefinite ones seem more subject to both repeating values, and to growth
or
change in the list of fields, and therefore may belong in a separate
many-to-many table. On the other hand, the Acord form is pretty stable,
and
in the unlikely event of change, how bad would it be to just add more
fields
to the Certs table?
Are you saying that Certificates have one-to-many "indefinite" fields? From
your above description, your Definite and Indefinite Cert fields appear to
be characterizing the Certificates (i.e., they are "attributes" of the
certificates). Why would you need to change the number of attributes? Yes,
you can always modify a table structure. Yes, spending the time before you
finalize the application cuts down on how much later changing you have to
do. In your situation, your "definite" fields for ProducerCode and
CertHolderCode seem like excellent candidates for lookup tables -- if you
add firms, you add them one place and do the lookup for these codes. But
the [CertDate] and the [NOCDays] and the others seem like
'fill-in-the-blank' type fields. It would be tough to try to generate the
list of all possible values, so why not just let folks fill in the
appropriate values (or check the checkbox or ...)?
Another question right here. Notice the Certs table has foreign keys for
three different firms, namely the Insured Firm, the Certificate Producer,
and
the Certificate Holder. Right now, I have all firms, regardless of type,
in
a single table. How can I have multiple foreign keys back to one common
table? Won't this confuse the daylights out of Access?
A human looking at that might get confused, but Access won't. If you tell
Access to use the row from [Firms] with ID = 17, it really won't matter
whether you tell it to do that for [InsuredFirm] or [Producer] or [Holder]
.... or for ALL THREE!
I notice in the
Northwind database there are separate tables for Suppliers and Customers.
I
thought I was doing right to put all my firms in one table. Was this a
mistake?
I'd keep them in one table. I suspect the reason for separate tables for
suppliers and customers is because they have too many un-shared attributes.
Yes, sure, they have names, addresses, etc. And if you wanted to get really
ana..., er, rigorous about normalizing, you COULD create a [Business] table
to hold all of them, and the common fields, then create "typeof" tables that
hold the data specific to each typeof ... but you have to look in multiple
places (or Access does) to pull it all together. Doable, but perhaps not
cost/time effective.
Definite Policy Fields:
FK InsurerCode (Id for the insurance firm issuing the policy)
FK PolicyTypeCode (Id for Policy Type, ie GL, Auto, Excess, Workers Comp,
etc)
Policy Number
PolicyDateEffective
PolicyDateExpires
Indefinite Policy Fields:
Type...
Basis...
Scope...
Limits...
Endorsements...
As was the case with Certs information, Indefinite Policy Fields are
subject
to repeating values and to variable and indeterminate field lists.
Different
types of policies have different lists of fields, so there has to be some
way
to prevent inappropriate associations. For example, an Additional Insured
Endorsement might apply to a General Liability policy, but not to an
Excess
Liability Policy. At this point, all our fields seem fixed, but who knows
what changes the future may bring? Again the question is whether to take
a
chance a cram all presently known fields into the Policies table, or set
up a
many-to-many relationship between the Policies table and a PolicyDetails
table.
I'd suggest, if you're comfortable with the above analysis on Certs, use a
similar approach here.
Another, less normalized, approach would be to create separate tables for
each type of policy, and just put the appropriate fields in each table.
This
would solve the problem of inappropriate associations between Policies and
Policy Details, but it would be less normalized and less flexible. For
example if the need arose to begin requiring a new type of policy for some
or
all of our subcontractors, this would mean creating an entirely new table.
I generally recommend against doing this. It would involve a lot more
maintenance than you've noted. You'd also have to modify queries, forms,
reports, code, etc.
This why I asked about others with experience in this same area, because
the
"right" structure depends on what you plan on doing with the data. I
wanted
to compare notes with someone else to see how they approached the task.
I disagree. I believe the "right" structure depends on your domain, and NOT
on the intended use. The "right" data, absolutely ...!
Because you have queries and forms and reports, you absolutely do NOT need
to make your table structure fit either your input or your output.
Please note that capturing the information from the Acord form is barely
one
third of the task. We also have to specify our insurance requirements in
detail for each subcontractor. Most insurance requirements will be the
same
from one subcontract to the next, but any of them may differ, so each
subcontract must have its own set of required values. The
subcontractor's
insurance certificates are then checked against those required values. If
the certificate is non-compliant, we want to report precisely which
parameters are at fault.
I'm not entirely clear from your description, but this sounds like it might
be amenable to an approach that associates one-to-many attributes (i.e.,
"insurance requirements") with each subcontractor. If that's a reasonable
statement, then look into using a main form/subform construction, or a
"paired listbox" approach (see the query wizard in action).
Good luck!
Regards
Jeff Boyce
Microsoft Access MVP
--
Disclaimer: This author may have received products and services mentioned
in this post. Mention and/or description of a product or service herein
does not constitute endorsement thereof.
Any code or pseudocode included in this post is offered "as is", with no
guarantee as to suitability.
You can thank the FTC of the USA for making this disclaimer
possible/necessary.
.