Product Table

J

janzak

I want to create a product table. I have many products with different
colors. How can I create my product table so I can search my products
by color or by product number. Also how can I make sure I do not enter
a duplicate product & color combination. For example, I can have many
product X with different colors. But I can not have more than one
product X in blue colors. And I can have many product Y with different
colors and only one product Y in blue color.

Thank you

Jan
 
R

Rick B

To search, you will simply have to specify which field you are searching and
what criteria. Not sure I understand that question.

Your second question is solved by creating a compound index in your table.
In other words, you create an index that consist of the Product and the
color. You tell it that this index can't contain duplicates.

In your table design-view, click View, then Indexes. Enter an index name
and then your field. In the next line, leave index name blank and enter
your second field. This will create a compound index. Make sure to set the
"Unique" property.

Refer to HELP or post back if you have more questions.
 
J

janzak

Thank you for your help.
How about if I make a combination "Primary Key" of both my Product ID
and Product Color? Does that work the same as your suggestion of making
a combination Index?

Thank you

Jan
 
Top