J
JohnE
I have an engineering tolerance test result that needs to be kept as a
decimal but the field is dropping the last zero entered. An example is if
the user types in 0.010, the last 0 is getting dropped. That 0 must be
there. (In engineering tolerance testing of med devices there is a
difference between .010 and .01.)
There is another field (hidden) that is to store the number of places after
the decimal point. So in the example above it should have 3 in the hidden
textbox. The code below is in the AfterUpdate event of the tolerance field
the user would enter the 0.010 but the hidden field will show 2 instead of 3.
If the user typed in 0.001, the hidden field shows 3, which is correct.
Mainly, if the last digit typed is 0, then it drops off and the count in the
hidden field is short by one.
Dim decCount As Long
decCount = Nz(Len(Mid([UpperTolerance], InStr([UpperTolerance], ".") + 1)), 0)
SignificantDigits.Value = decCount
Am I missing something in the code above that would count the ending 0? I
tried this in the BeforeUpdate of the tolerance field and got the same
result. I need help on this.
Thanks.
John
decimal but the field is dropping the last zero entered. An example is if
the user types in 0.010, the last 0 is getting dropped. That 0 must be
there. (In engineering tolerance testing of med devices there is a
difference between .010 and .01.)
There is another field (hidden) that is to store the number of places after
the decimal point. So in the example above it should have 3 in the hidden
textbox. The code below is in the AfterUpdate event of the tolerance field
the user would enter the 0.010 but the hidden field will show 2 instead of 3.
If the user typed in 0.001, the hidden field shows 3, which is correct.
Mainly, if the last digit typed is 0, then it drops off and the count in the
hidden field is short by one.
Dim decCount As Long
decCount = Nz(Len(Mid([UpperTolerance], InStr([UpperTolerance], ".") + 1)), 0)
SignificantDigits.Value = decCount
Am I missing something in the code above that would count the ending 0? I
tried this in the BeforeUpdate of the tolerance field and got the same
result. I need help on this.
Thanks.
John