Hi All,
I'm working on putting together a MS Access based Database at work and have a bit of an issue. We've got "Parts" that I'm trying to describe in Access. Ultimately the descriptors for these parts frequently change. Right now we may have some and then two months from now there are new things we need to use to describe the parts - different, changing attributes basically. These attributes are used later for things like pricing, analysis, etc.
So that I am not constantly having to go in and make the modifications myself to add these new attributes I want to give the uses (many not so tech savy) the ability to add the new attributes as needed. My current idea is to have:
The problem that I have is the attributes will not all be of the same data types. I know that Access doesn't really do variant data type fields, but I'm trying to work around that.
My current thought is on the attribute value table to have a field for Numeric Data and a field for NonNumeric data. For anything that is text based (type, etc.) it should go find into the NonNumeric. For other stuff, Integers (not particularly big integers), Decimal numbers, Booleans - store them in the Numeric field as a Double.
Additionally as I was reading elsewhere on here - I could probably use a Union query to create a query that spits out only one column instead of the two. My other thoughts were to store everything - Numbers and Text - in a Text field and then cast them to the correct data type when they are used. Or instead of two fields on the same table - I thought of doing two separate tables one for Numerics and one for Non.
I'm not particularly pleased with any of these ideas, but they are what I've come up with right now.
Is one of these solutions better than the others? Is doing things this way a horrible idea? Any alternative solutions? If anyone has any thoughts I would greatly appreciate it.
I'm working on putting together a MS Access based Database at work and have a bit of an issue. We've got "Parts" that I'm trying to describe in Access. Ultimately the descriptors for these parts frequently change. Right now we may have some and then two months from now there are new things we need to use to describe the parts - different, changing attributes basically. These attributes are used later for things like pricing, analysis, etc.
So that I am not constantly having to go in and make the modifications myself to add these new attributes I want to give the uses (many not so tech savy) the ability to add the new attributes as needed. My current idea is to have:
- A basic Part table
- An Attribute table (for the master attribute - Length, Width, Type, etc.)
- An Attribute Value table (that can be populated with the different values for each attribute Length = 1, Length = 2, Length = 3, etc. - pulling from the Attribute Table)
- A table to link Part to Attribute Value
The problem that I have is the attributes will not all be of the same data types. I know that Access doesn't really do variant data type fields, but I'm trying to work around that.
My current thought is on the attribute value table to have a field for Numeric Data and a field for NonNumeric data. For anything that is text based (type, etc.) it should go find into the NonNumeric. For other stuff, Integers (not particularly big integers), Decimal numbers, Booleans - store them in the Numeric field as a Double.
Additionally as I was reading elsewhere on here - I could probably use a Union query to create a query that spits out only one column instead of the two. My other thoughts were to store everything - Numbers and Text - in a Text field and then cast them to the correct data type when they are used. Or instead of two fields on the same table - I thought of doing two separate tables one for Numerics and one for Non.
I'm not particularly pleased with any of these ideas, but they are what I've come up with right now.
Is one of these solutions better than the others? Is doing things this way a horrible idea? Any alternative solutions? If anyone has any thoughts I would greatly appreciate it.