roundup in access if decimal is >0

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

Guest

I have a calculated field in a subform called "lblcrew_formula" which tells
me how many people I need on a particular job.(This is in my form footer as
I'm using datasheet view. However also on my subform, I have a field
"lblcrew" which then takes the figures from lblcrew_formula - which is fine,
but the problem I have is that I need the lblcrew field to be able to round
up the figure if it has a decimal, as I can't have .1 of a person if you know
what I mean.

Any help would be greatly appreciated
 
<< air code >>
If Int(Me.lblcrew_formula) = Me.lblcrew_formula Then
'-- No decimal component
Me.lblcrew = Me.lblcrew_formula
Else
Me.lblcrew = Me.lblcrew_formula + 1
End If

I have a calculated field in a subform called "lblcrew_formula" which tells
me how many people I need on a particular job.(This is in my form footer as
I'm using datasheet view. However also on my subform, I have a field
"lblcrew" which then takes the figures from lblcrew_formula - which is fine,
but the problem I have is that I need the lblcrew field to be able to round
up the figure if it has a decimal, as I can't have .1 of a person if you know
what I mean.

Any help would be greatly appreciated

_______________________________________________
hth - RuralGuy (RG for short)
Please post to the NewsGroup so all may benefit.
 
Int() rounds down, so negate the value, use Int(), and negate the result to
round up, e.g.:
= - Int( - [lblcrew_formula])
 
Thanks very much Allen - you're a star!

Allen Browne said:
Int() rounds down, so negate the value, use Int(), and negate the result to
round up, e.g.:
= - Int( - [lblcrew_formula])

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Lynne said:
I have a calculated field in a subform called "lblcrew_formula" which tells
me how many people I need on a particular job.(This is in my form footer
as
I'm using datasheet view. However also on my subform, I have a field
"lblcrew" which then takes the figures from lblcrew_formula - which is
fine,
but the problem I have is that I need the lblcrew field to be able to
round
up the figure if it has a decimal, as I can't have .1 of a person if you
know
what I mean.

Any help would be greatly appreciated
 
Back
Top