Rounding a number displaying in a field

  • Thread starter Thread starter BobV
  • Start date Start date
B

BobV

Group:

I have a bound field on a form that has its Format property set to percent
and its Decimal property set to 2. When a user enters 75.5 into the field,
75.5 displays in the field; however, when you go back and click on the
number in the field, a very long number appears (.75499995....).

Question:
How do I round the number to 75.5 that both displays in the field and also
when I go back and click on the number? I know that I have seen a formula to
put in one of the field's events, but can't find it. (I currently have an
AfterUpdate event for this field.)

Thanks,
BobV
 
Private Sub ControlName_AfterUpdate()
Me.ControlName.Value = Round(Me.ControlName.Value, 1)
End Sub
 
Back
Top