Hi,
I have a form where I input numbers. If the number inputed is greater that
99.99 I want to found off to the nearest whole number. What would the code
be for doing this and in which event should I place the code? I've tried
various things, none of which worked.
Thanks

Signature
Phil
John W. Vinson - 17 Sep 2007 18:17 GMT
>Hi,
>I have a form where I input numbers. If the number inputed is greater that
[quoted text clipped - 3 lines]
>
>Thanks
You can use the AfterUpdate event of the textbox in which you're entering the
number (confusingly enough, the BeforeUpdate event doesn't work but
AfterUpdate does):
Private Sub txtMyTextbox_AfterUpdate()
If Me!txtMyTextbox > 99.99 Then
Me!txtMyTextbox = Round(Me!txtMyTextbox, 0)
End If
End Sub
John W. Vinson [MVP]
Maurice - 17 Sep 2007 18:22 GMT
Maybe it is better to place that in your query if that's the recordsource.
You could use something like:
iif([number]>99.99;cint(number);number)
cint will make the number a whole number.

Signature
Maurice Ausum
> Hi,
> I have a form where I input numbers. If the number inputed is greater that
[quoted text clipped - 3 lines]
>
> Thanks