decimal to round off

G

Gerald

Dears,

how to round off a number e.g. 99.90 to 99 not 100 and 99.09 to 99 as well
i.e. it has to be round off to the least.

thanks
 
A

Allen Browne

In a form.

Use the AfterUpdate event of the text box where the user enters the value to
chop of the fractional part.
 
G

Gerald

Used Int() in AfterUpdate event in a form under the same textbox

gives me a compile error

plz advise
 
G

Gerald

Hi Allen,

as per your below suggestion
In a form.

Use the AfterUpdate event of the text box where the user enters the value to
chop of the fractional part.

I used Int() in AfterUpdate event of the textbox, thats when the error pops
 
A

Allen Browne

Gerald, if you just placed the word:
Int()
in there, you are going to need to do some more research to see how to use
this function.

You could start with the help file built into Access.

I don't think there is anything else I can add further to this thread.
 
G

Gerald

thanks for your help.

all I neede was how to roundoff a number e.g. 840.66 to 840, tried help in
access, but seems not enough info.

anyone's advice on this will appreciated
 
J

JethroUK©

i'd be inclined to use the Before Update event


Sub MyTextBox_BeforeUpdate

mytextbox = INT(mytextbox)

End Sub
 
M

Marshall Barton

Jethro, you can not change the value in the BeforeUpdate
event.

Gerald,
If you want help, you need to respond to the requests for
more information. Just repeating your question or saying
"it" generated an error does not help us help you. Two
people have requested that you post the code that you tried,
is there a reason that you have failed to respond to those
requests?
 
G

Gerald

Sorry, Marsh. I do apologize for not making myself clear.

I will try working on beforeupdate

thanks for all your help

Cheers



Marshall Barton said:
Jethro, you can not change the value in the BeforeUpdate
event.

Gerald,
If you want help, you need to respond to the requests for
more information. Just repeating your question or saying
"it" generated an error does not help us help you. Two
people have requested that you post the code that you tried,
is there a reason that you have failed to respond to those
requests?
--
Marsh
MVP [MS Access]


JethroUK© said:
i'd be inclined to use the Before Update event


Sub MyTextBox_BeforeUpdate

mytextbox = INT(mytextbox)

End Sub
 
G

Gerald

mytextbox = Int(mytextbox) works fine in AfterUpdate

Appreciate all yourhelp,



Marshall Barton said:
Jethro, you can not change the value in the BeforeUpdate
event.

Gerald,
If you want help, you need to respond to the requests for
more information. Just repeating your question or saying
"it" generated an error does not help us help you. Two
people have requested that you post the code that you tried,
is there a reason that you have failed to respond to those
requests?
--
Marsh
MVP [MS Access]


JethroUK© said:
i'd be inclined to use the Before Update event


Sub MyTextBox_BeforeUpdate

mytextbox = INT(mytextbox)

End Sub
 
Top