D
Diana Criscione
I have some code which checks to see if the total percentage amounts of a
formula's ingredients equal 100% (or 1). The values in the percent field are
data type double and are entered as decimals (.2 or .95, etc). Here's an
example of the code...
Public Function CheckPercent(lngID as Long) as Boolean
....
If rs!SumOfIngredientPercent = 1 Then
CheckPercent = True
Else
CheckPercent = False
End If
....
End Function
On some of the records, the code returns False even though the statement
should return True. I have stepped thru the code numerous times on the
records where it should return true. The value = 1 but the code just
continues to the Else statement. Any suggestions on why this could be
happening? I have tried changing the statement to "If
rs!SumOfIngredientPercent >=1" just in case, but the same thing occurs.
Again, what's weird is that most of the times it returns the correct result.
For example, records 1-13 return accurately and then record 14 doesn't.
TIA
Diana
formula's ingredients equal 100% (or 1). The values in the percent field are
data type double and are entered as decimals (.2 or .95, etc). Here's an
example of the code...
Public Function CheckPercent(lngID as Long) as Boolean
....
If rs!SumOfIngredientPercent = 1 Then
CheckPercent = True
Else
CheckPercent = False
End If
....
End Function
On some of the records, the code returns False even though the statement
should return True. I have stepped thru the code numerous times on the
records where it should return true. The value = 1 but the code just
continues to the Else statement. Any suggestions on why this could be
happening? I have tried changing the statement to "If
rs!SumOfIngredientPercent >=1" just in case, but the same thing occurs.
Again, what's weird is that most of the times it returns the correct result.
For example, records 1-13 return accurately and then record 14 doesn't.
TIA
Diana