decimal to round off

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
In a form.

Use the AfterUpdate event of the text box where the user enters the value to
chop of the fractional part.
 
Used Int() in AfterUpdate event in a form under the same textbox

gives me a compile error

plz advise
 
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
 
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.
 
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
 
i'd be inclined to use the Before Update event


Sub MyTextBox_BeforeUpdate

mytextbox = INT(mytextbox)

End Sub
 
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?
 
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
 
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
 
Back
Top