First up, it may not be worth the effort to change your y/n field into a
numeric one. It's probably fine the way it is, now that you have everything
else in place.
The way I personally relate persons and companies is to put them all in the
one table. You can then create groupings of clients (companies, households,
committees, ...) either as formal or ad hoc groups. Again, you already have
a suitable, normalized structure in place so I'm not suggesting you change
it, but if you are interested in alternative approaches, the core idea is
explained here:
People in households and companies - modeling human relationships
at:
http://allenbrowne.com/AppHuman.html
That example doesn't include addresses and phone numbers, but would use a
related table of addresses with a ClientID foreign key field (so one client
can have many addresses.) Since "client" could be person or company, a
company can have multiple addresses, a person can have multiple addresses in
their own right, and a person can have an address that applies to specific
situations (e.g. you can use the address of the company when addressing that
person in their role at that company, but use their personal address or the
address of another company where the person works in other contexts.)
It's very flexible, and quite a simple structure. The only problem I have is
when somebody says they want a flat-file printout of the data, showing how
everyone relates to everyone/everything else. This web of human
relationships does not lend itself to a simple print out (even with just a
few thousand clients), because the levels of connectivity are unlimited and
potentially recursive.
If the Priority (Number) field intrigues you, the way I program that is that
the first address entered for a client defaults to 1, and the next to 2, and
so on (assigned using DMax() in Form_BeforeInsert). Most often, the user
enters the main address first, so it all works without them having to think
much. There is no requirement for the field to be unique, i.e. a client can
have two addresses both of priority 1 if they don't care. (Makes it simpler
to re-prioritize.) Documentation says the software is allowed to serve up
either address when there are equal priorities; in practice, they get the
lower autonumber value (so usually the one entered first.) Similarly there's
no requirement for the priority numbers to be sequential, i.e. it's purely
for sorting purposes.
The address table we use also has a StartDate field (Date/Time, required,
defaults to today) indicating when this address becomes operational, and an
EndDate field (Date/Time, Null if the address is current) indicating when to
stop using this address. This means the user can maintain a history of
addresses, and the function/subquery can determine what would have been the
client's default address at any time. (We generally let them delete
addresses too, unless the client has special business rules requiring the
history to be complete.)
Not sure if that answers the question you were asking.
Hopefully it stimulates some creative thinking.
--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users -
http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
"ngincolorado" <(E-Mail Removed)> wrote in message
news:37654950-A1B6-489D-A368-(E-Mail Removed)...
>> The 2nd argument is used only if the first is null.
>
> The way too easy solution sometimes flies right by me - thanks for going
> easy on me.
>
>> Okay this is a good structure.
>
> Thanks again - I'm a little defensive on the structure because it was the
> only solution I thought I could use to handle the various relationships,
> and
> the client knows just enough about database design to be dangerously
> critical
> of me "making it more complex than it needs to be".
>
>> I prefer a Number field to specify the priorirty rather that a yes/no to
>> indicate if it is the primary one, because it means the records are
>> independent of each other, e.g. if the number 1 contact/address is out of
>> circulation temporarily or permanently, the second one gets returned by
>> your
>> function/subquery.
>>
>> It usually involves a subquery to return the ID of the preferred, current
>> address. Alternatively write a VBA function that accepts the arguments
>> for
>> the client, and optionally address type and date (if you have a full
>> history
>> of addresses), and returns the string suited for the address panel
>> (OpenRecordset sorted as desired, and build string from first record.)
>
> The home office "direct" Address I'm trying to incorporate is linked to
> the
> Contact through the tblCONTACTSMULTIPLE without being assigned to a
> CompanyID. But for now, all of my queries draw a Contact's Address
> through
> the [PrimaryCompany] that is indicated, using the AddressID assigned to
> the
> Company in the bridge table; the AddressID field is blank in the
> tblCONTACTSMULTIPLE for all ContactMultipleIDs with ContactIDs, except for
> those with Addresses independent of any Company they are linked to. This
> is
> why right now the queries and reports only display the main Company
> information until I can work through this linkage/priority issue to
> display
> the "direct" Address first, but If Null then display the main Company
> Address.
>
> I've thought about adding [DirectAddressLine1], [DirectCity], etc. fields
> to
> tblCONTACTSMULTIPLE which is where I have my direct [OfficePhone],
> [OfficeFax] fields, rather than in tblADDRESS linked by AddressID but my
> instincts tell me I'll have problems with that. Your Priority Number
> field
> idea is intriguing, but I have concerns about it because it means
> populating
> a couple thousand Contacts with a priority level I honestly have no clue
> how
> to assign (Owners, Presidents and GMs currently are typical
> [PrimayContact],
> [PrimaryCompany] Contacts; COO's, Sales Mgrs, EVPs, Attorneys, Vendor
> Reps,
> etc. have no priority that can be discerned for the purposes of my client,
> but some of them have home "direct" addresses).
>
> A problem I foresee is the structure of how I've built the links for
> AddressID to ContactID through the [PrimaryCompany] AddressID for the 80%
> who
> belong to just one company and have no direct address concerns, and to
> link
> an AddressID directly to a ContactID (who may or may not be a
> [PrimaryContact]) through a ContactsMultipleID involves another data entry
> step to enter in the same address for the 97% of ContactIDs who will have
> no
> direct address was a method the client rejected.
>
> Also, it's worth noting that in tblCONTACTSMULTIPLE, the 3% I'm concerned
> with are the only Contact records that have a ContactsMultipleID,
> ContactID
> and AddressID assigned, with no CompanyID assigned. The 97% have
> ContactsMultipleID, ContactID and CompanyID assigned, with no AddressID
> assigned. And all Company records have ContactsMultipleID, CompanyID and
> AddressID assigned, with no ContactID assigned. Can these distinctions be
> used in creating a query that handles my dilemma?
>
> Lastly, is there a streamlined way to change my Primary Contact/Company
> field data type from Y/N to Numeric across all of the queries, forms and
> reports I've already developed so that if I come to the conclusion that
> your
> Priority Numeric proposal is still the most feasible and I change the
> field
> type in the table I won't have to go to every query, form and report to
> make
> the corresponding changes. I don't have Object Dependencies or
> AutoCorrect
> enabled in this database - they corrupted a prior database I developed and
> I
> had to export everything to a new database. If not, I guess making those
> manual data type changes falls under the less glamorous part of database
> development.
>
> Thanks again.