On Sat, 26 Feb 2005 10:33:01 -0800, wattog
wrote:
I can't figure out whether I need a different table for each group, or
whether I can code records in a table for multiple categories. If I do use
different tables for each group, how do I connect the same person who appears
in several groups, so that I will make changes to only one record that will
be reflected across all instances of that record in other tables.
If you have a "many to many" relationship between Contacts and
Categories, the proper way to structure your tables is to have *three*
tables:
Contacts
ContactID Primary Key
FirstName
LastName
etc etc
Categories
Category Text Primary Key
ContactCategories
ContactID link to Contacts
Category link to Categories
Thus if a contact is in five categories, there would be five records
in ContactCategories for that contact; if you have 318 contacts in the
"Prospective Customer" category, there'd be 318 records in
ContactCategories, each with a different ContactID.
You could then create a Query joining Contacts to ContactCategories
with a criterion on Category to find all contacts in a particular
category.
John W. Vinson[MVP]
|