Hi All;
I've created a form that will calculate entered values and convert it over to another value. For instance work hours to the number of days.
The code I am using to convert work hours to days (24 work hours in the day). The code calculates fine for any number greater than 2 including fractions, but if the value is either 1 or 2, the return is screwed up.
1 = 4.166 (it should be 0.0416)
2 = 8.333 (it should be 0.083)
Where is the multiply by 100 coming from for these two integers?
here is the code snippet.
Thank you for the assist!
Mike
I've created a form that will calculate entered values and convert it over to another value. For instance work hours to the number of days.
The code I am using to convert work hours to days (24 work hours in the day). The code calculates fine for any number greater than 2 including fractions, but if the value is either 1 or 2, the return is screwed up.
1 = 4.166 (it should be 0.0416)
2 = 8.333 (it should be 0.083)
Where is the multiply by 100 coming from for these two integers?
here is the code snippet.
Code:
' Hours to Days (24 hours = 1 day)
If hour_box2_24 = "" Then
day_box2_24 = ""
ElseIf hour_box2_24 > 0 Then
day_box2_24 = hour_box2_24 / 24
ElseIf hour_box2_24 = 0 Then
day_box2_24 = 0
ElseIf hour_box2_24 < 0 Then
day_box2_24 = "Error"
End If
Thank you for the assist!
Mike