Harley:
The problem is with the design of the table. Having separate Boolean
(Yes/No) columns for each category is what's called in the jargon of the
relational model 'encoding data as column headings'. The relational model
requires that data should be stored as value at column positions in tables
and in no other way. This is a common design error, but a design error none
the less, and as you've found out, causes problems.
The correct design would be to create a new Categories table with one row
for each category. The relationship between categories and Patents is
many-to-many as each patent can be in one or more category, and each category
can apply to one or more patents. A many-to-many relationship is modelled by
a third table, PatentCategories say, with two columns , e.g. PatentID and
CategoryID which reference the primary keys of the Patents and Categories
table. These two columns form the composite primary key of PatentCategories.
Data entry for this type of data is normally by means of a Patents form
based on the Patents table and a subform based on the PatentCategories table.
The subform would usually be in continuous form view and have one control, a
combo box bound to the CategoryID field but showing the Category text field
values looked up from the categories table. The combo box wizard can set
this up for you. The form and subform are linked on the PatentID fields.
For your report you simply join the three tables in a query and group the
report on the Category field.
If you retain your Boolean columns in the Patents table until the
PatentCategories table has been populated you can fill the latter quite
easily by means of a series of 9 temporary Append queries which , e.g. if the
Category ID for Biological is 1 then the query to create the rows for this
category would go like this:
INSERT INTO PatentCategories(PatentID,CategoryID)
SELECT PatentID, 1
FROM Patents
WHERE Biological;
Once you've run the 9 queries and are satisfied that the PatentCategories
table is correctly populated you can delete the 9 Boolean columns from the
Patents table.
Ken Sheridan
Stafford, England