G
ganjula
I think I've run myself up a blind alley... hope someone can redirect
me in a more productive direction...
I have an existing system for tracking real estate Acquisitions - an
Acquisition
involves a set of steps and information for acquiring a particular Tract
within
a particular Town. Hence, there are tables like these (BOLD ITEMS ARE KEY
FIELDS):
Tracts: TOWN, TRACTNUM, Address, Description...
Towns: TOWNID, Name, State...
Acquisitions: TOWN, TRACTNUM, Milestone, Agent, Cost...
I am trying to add the ability to track Survey work. Sometimes a Survey is
specific to a particular Tract within a particular Town; other times it might
be for a group of Tracts, or for a Town in general, or for no Town at all.
In the case of a Survey for a particular Town and TractNum (the most common
case),
things can be very simple:
Surveys: SURVEYID, Town, TractNum, Surveyor, Acres...
The obvious thing is to join Surveys to Tracts using Town+TractNum and
enforce
referential integrity (RI)... this works just fine for Town+TractNum Surveys.
It also works fine for non-Town, non-TractNum Surveys... I can leave both
Town
and TractNum as Null in the Surveys table and all is well.
But, this scheme does NOT allow me to have Town-only Survey work, where I
specify
a value for the Town in Surveys, but leave the TractNum as Null. With RI
enforced,
Access imposes an all-or-nothing rule on the Town and TractNum fields in
Surveys:
either both must be Null, or together they must reference a valid record in
Tracts.
So how does one deal with a situation like this, where I want RI enforced, but
only some of the time, or only partially? Conceptually, I'd like something
like this:
SurveyType Town? TractNum? RI?
Acquisition yes yes Yes (full - Town + TractNum)
Town-level yes no Yes (partial - Town only), or No
Other no no No
I don't believe there is such a thing as "conditional RI", which makes me
think
I've blinded myself to some other way of looking at this problem and finding
the right solution.
Thanks in advance for any ideas, pointers, whacks on the head...
me in a more productive direction...
I have an existing system for tracking real estate Acquisitions - an
Acquisition
involves a set of steps and information for acquiring a particular Tract
within
a particular Town. Hence, there are tables like these (BOLD ITEMS ARE KEY
FIELDS):
Tracts: TOWN, TRACTNUM, Address, Description...
Towns: TOWNID, Name, State...
Acquisitions: TOWN, TRACTNUM, Milestone, Agent, Cost...
I am trying to add the ability to track Survey work. Sometimes a Survey is
specific to a particular Tract within a particular Town; other times it might
be for a group of Tracts, or for a Town in general, or for no Town at all.
In the case of a Survey for a particular Town and TractNum (the most common
case),
things can be very simple:
Surveys: SURVEYID, Town, TractNum, Surveyor, Acres...
The obvious thing is to join Surveys to Tracts using Town+TractNum and
enforce
referential integrity (RI)... this works just fine for Town+TractNum Surveys.
It also works fine for non-Town, non-TractNum Surveys... I can leave both
Town
and TractNum as Null in the Surveys table and all is well.
But, this scheme does NOT allow me to have Town-only Survey work, where I
specify
a value for the Town in Surveys, but leave the TractNum as Null. With RI
enforced,
Access imposes an all-or-nothing rule on the Town and TractNum fields in
Surveys:
either both must be Null, or together they must reference a valid record in
Tracts.
So how does one deal with a situation like this, where I want RI enforced, but
only some of the time, or only partially? Conceptually, I'd like something
like this:
SurveyType Town? TractNum? RI?
Acquisition yes yes Yes (full - Town + TractNum)
Town-level yes no Yes (partial - Town only), or No
Other no no No
I don't believe there is such a thing as "conditional RI", which makes me
think
I've blinded myself to some other way of looking at this problem and finding
the right solution.
Thanks in advance for any ideas, pointers, whacks on the head...