To start with the last question, text fields are left justified and that is why 11 sorts before 2 because the first 1 in 11 is less than 2. When you zero-fill numbers stored as text, that has the effect of right justifying them and so they sort the way you would expect numbers to sort.
If there is any possiblity that in the future you might need alpha characters in the code, store it as text with leading zeros. Otherwise, you can store it as an integer and zero-fill it for display using the Format(YourField, "000") function.
I must say I don’t understand this:-
001-003-001 is 'waste acids'-'waste hydrochloric acid'-'hydrochloric acid (d002)'.
001 = 'waste acids'
and
001 = 'hydrochloric acid (d002)'
It looks like the digit code is an index into a description table but for that to work the two descriptions would need to be in separate tables.
Also, D002 is an EPA Waste Code which can apply to many different chemicals not just hydrochloric acid. (It appears to be based on pH range.) So having 'hydrochloric acid (d002)' in one field is actually storing two pieces of information in that field.
And since 'waste hydrochloric acid' is already indexed by 003 and that 'waste hydrochloric acid' may not be in the D002 pH range (Corrosive is <= 2 pH or > 12.5 pH) then having a description of 'hydrochloric acid (D002)' would seem redundant.
It would appear to be better to store the chemical in one table and the waste code in another table. 'hydrochloric acid (D002)' can then be concatenated by chemical index 003 in the chemical table and whatever the index of D002 is in an EPA Waste Code table.
With that setup all the digit groups become indexes and so would be numbers even though no calculations are done on those numbers. The numbers can be displayed with leading zeros if required but they are still numbers and not text.
Others may have more input on the table structure but I don’t think things like 'hydrochloric acid (D002)' should appear in any single table field.
Chris.
It isn't clear whether you are using some standardized code, or dreaming something up as you go. If there is a codification scheme that applies to your industry, why not use it. Why re-invent something that has been designed.
I've seen a lot of codification schemes that have fallen on to limited/no use because of some unforeseen condition --- then it's usually let's start putting in some alpha chars or similar. And when that starts going south, someone suggests --let's start with Z..... and it goes downhill from there...
????
I did some work with ECCMA and UNSPSC --seems you have considered any existing codes.
Good luck with your project.
I would use the Format(yourfield,"000) in the query rather than the form/report and that way, it could be used for sorting also.
Perhaps it would be prudent to test the data interchange methods before making a decision as to what storage method to use. Examples of data interchange methods may be CSV file transfer or scanned Bar codes, we don’t know. Nor do we know if the transfers between systems would require encryption. In deed, the Army may force a data interchange standard, we don’t know.
So the data type of storage will be based on many things, not just the ability to do calculations on the raw data as per your first question.
Chris.
Can you please explain why you think the code contained within those two sites would be superior to the system being designed here?
After taking a cursory look through UNSPSC codes, there's no way those codes would be useful for us. The code doesn't contain most of the wastes that we generate, and the code is exceptionally long. Additionally, the code itself is not categorically linked to other items of the same type.
As far as ECCMA, I couldn't find a sampling of the codes they use.
As I mentioned earlier, the system we will be using has been used extensivly and successfully other places.
I was trying only to suggest don't dream something up for your local use if you have to fit into a bigger picture.
From post #8.
>>This coding scheme is only part of a larger scheme. We are the waste-end, and another program is developing a material-end numbering scheme that ties into our numbers. The effect is that we can track a particular type of material through from it's virgin form, through a process (that creates wastes) and to its waste form.<<
From post #15
>> This system that we're implementing is going to be built from the ground up - there will be zero interfacing with any other system. In fact, I believe that the Access DB will be the only system that will be in place.<<
Juxtaposition please.
Chris.