Criteria?

A

Angel_1

I have a field called categories.
In this field there are 8 categories.
Some records have more than one catergory.
Is there any way I can use a combo box to be able to choose more than one
category.
I have set up a query to view all records with "A" category, it does not
show records that are "A" / "B" category.
Confusing explanation i know, any help would be appreciated.
 
J

John Vinson

I have a field called categories.
In this field there are 8 categories.
Some records have more than one catergory.

That's a BAD IDEA.

Storing multiple values in a single field violates the basic
relational principle that fields should be "atomic" - have one and
only one value.

If you have a Many (records) to Many (categories) relationship, the
proper table structure is to have THREE tables:

<your current table, with I'll call it RecordID as primary key>

Categories
Category <eight different records, at least right now>

CategoryAssignment
RecordID <link to your main table>
Category <link to Categories>

If a record has four categories assigned, there would be four records
in the CategoryAssignment table.
Is there any way I can use a combo box to be able to choose more than one
category.
No.

I have set up a query to view all records with "A" category, it does not
show records that are "A" / "B" category.

Exactly, because that's not what you have stored in the field. The
text string "A" is not equal to the text string "A / B".
Confusing explanation i know, any help would be appreciated.


John W. Vinson[MVP]
 
K

KARL DEWEY

Use this for criteria --
Like "*"&[Enter category]&"*"

But a better way to store date would be to store the data in separate
records and have a one-to-many relations.
 
Top