L
Lars Brownie
After Jeff Boyce opened my eyes yesterday I started normalizing a
hierarchical cost category sctructure and trying to find an intuitive GUI.
Now it occurs to me why I've kept avoiding this path ;-)
This is what I had:
tbTransaction - ID_main(PK), Other transactions fields, Cat1, Cat2, Cat3
tbCategory - ID_category(PK), Cat1, Cat2, Cat3 (Unique on last 3 text
fields)
Example data in tbCategory:
ID_category Cat1 Cat2 Cat3
1 Committee Office supllies Cartridges
2 Committee Office supplies Paper/envelopes
3 Savings Reservation 4th Anniversary
In my transaction form I had 3 cascading combo's to fill in the category
fields. So I stored all 3 category textvalues in my transaction table.
This is what I have now:
tbTransaction - ID_main(PK), Other transactions fields, ID_cat2cat3
tbCategory1 - ID_cat1(PK), Category1(Unique)
tbCategory2 - ID_cat2(PK), Category2(Unique)
tbCategory3 - ID_cat3(PK), Category3(Unique)
tbCat1Cat2 - ID_cat1cat2(PK), ID_cat1, ID_cat2(Unique on last 2 fields)
tbCat2Cat3 - ID_cat2cat3(PK), ID_cat1cat2, ID_cat3(Unique on last 2 fields)
In tbTransaction I only store ID_cat2cat3 from which I can derive the 3 cat
values (by linking).
Three questions:
1. Is this properly normalized?
2. What would be an easy to use GUI for selecting categories and for
entering new categories?
Ad 2: if I would still want the three combo's on my form how would I store
for instance cat1 when the user selects it, since it's not known yet what
the user will pick for cat 2 and 3. So ID_catcat2 is not known yet. Or
should I make a special category form to pick from and to enter new
categories?
3. I also have costs that only have 2 categories. Should I add a cat3 null
value or 'No category 3' text value for that.
Thanks in advance, Lars
hierarchical cost category sctructure and trying to find an intuitive GUI.
Now it occurs to me why I've kept avoiding this path ;-)
This is what I had:
tbTransaction - ID_main(PK), Other transactions fields, Cat1, Cat2, Cat3
tbCategory - ID_category(PK), Cat1, Cat2, Cat3 (Unique on last 3 text
fields)
Example data in tbCategory:
ID_category Cat1 Cat2 Cat3
1 Committee Office supllies Cartridges
2 Committee Office supplies Paper/envelopes
3 Savings Reservation 4th Anniversary
In my transaction form I had 3 cascading combo's to fill in the category
fields. So I stored all 3 category textvalues in my transaction table.
This is what I have now:
tbTransaction - ID_main(PK), Other transactions fields, ID_cat2cat3
tbCategory1 - ID_cat1(PK), Category1(Unique)
tbCategory2 - ID_cat2(PK), Category2(Unique)
tbCategory3 - ID_cat3(PK), Category3(Unique)
tbCat1Cat2 - ID_cat1cat2(PK), ID_cat1, ID_cat2(Unique on last 2 fields)
tbCat2Cat3 - ID_cat2cat3(PK), ID_cat1cat2, ID_cat3(Unique on last 2 fields)
In tbTransaction I only store ID_cat2cat3 from which I can derive the 3 cat
values (by linking).
Three questions:
1. Is this properly normalized?
2. What would be an easy to use GUI for selecting categories and for
entering new categories?
Ad 2: if I would still want the three combo's on my form how would I store
for instance cat1 when the user selects it, since it's not known yet what
the user will pick for cat 2 and 3. So ID_catcat2 is not known yet. Or
should I make a special category form to pick from and to enter new
categories?
3. I also have costs that only have 2 categories. Should I add a cat3 null
value or 'No category 3' text value for that.
Thanks in advance, Lars