Letting the user decide

  • Thread starter Thread starter Dale Fye
  • Start date Start date
D

Dale Fye

I'm developing a database that will allow my office to categorize a variety
of items in multiple ways (size, color, weight, ...), and the number of ways
they want to do this categorization is constantly changing. So, what I have
done is created a Categorie_Values table, that includes fields:

Cat_Va_ID Cat_CD Cat_Value
1 Size Small
2 Size Medium
3 Size Large
4 Color Red
5 Color Blue
....

Next, I created table to store the category values for each item.

Item_ID, Cat_Val_ID


I'm not set on this structure, so would appreciate any recommendations. At
any rate. What I want to do is similar to the Outlook contacts list, where I
present the user with several different options for which categories to
display (as in the Outlook phone numbers or email address sections). They
click on a label and select which Category they want to assign to that label.
Then, the combo box that is associated with that label gets filtered to
display the associated category values and stores the result in the
one-to-many table.

Does anyone have an example of how to implement this?

I've figured out how to get the label to pop up a menu with options for the
labels caption, and how to modify the rowsource for the combo box, but am
unsure how to populate the combo with the values in the Item_Cat_Values table.

Would appreciate any suggestions, including table structure modifications.

Dale

email address is invalid
Please reply to newsgroup only.
 
hi Dale,

Dale said:
I'm developing a database that will allow my office to categorize a variety
of items in multiple ways (size, color, weight, ...), and the number of ways
they want to do this categorization is constantly changing.
Take a look at the EAV-model:

http://en.wikipedia.org/wiki/Entity-Attribute-Value_model

Your items are the entity. The categories are your attributes. Your
values are restricted to predefined sets (enumerations). Maybe you can
say that your values are normalized using DKNF.
Cat_Va_ID Cat_CD Cat_Value
1 Size Small
2 Size Medium
3 Size Large
This is not normalized:

Category: id(PK), categoryName
CategoryValues: id(PK), idCategory, categoryValue
Next, I created table to store the category values for each item.
Item_ID, Cat_Val_ID
This is okay.


mfG
--> stefan <--
 
Stefan,

Thanks for the reference. I've got the concept right, I abbreviated my
post, but my table structure is correct.

The problem I'm trying to solve is how to display the data in a form. I
could not figure out a relatively simple way of displaying the information,
so I went with unbound controls, that I post to the table via code in the
forms beforeupdate event.

If there is a more elegant way to do this, that is what I am looking for.

Dale
 
Back
Top