Ceiling formula in Access 2000 Form

KEKeogh

Registered User.
Local time
Today, 02:10
Joined
May 4, 2011
Messages
80
Okay everything I've found doesn't seem to work.

I have a textbox [text22] that has a number in it that I want rounded up to the nearest 5 in a different textbox [text26].

Example

[text22] = 13 then [text26] = 15

I used the Ceiling function easily enough in Excel but now I want this in an Acess Form.

Thanks
Kathie
 
By 'nearest 5' do you mean up to the 'nearest number evenly divisible by 5,' i.e. 5, 10, 15, etc.?

And if the input number is already evenly divisible by 5 leave the number as it was input?

If so,
Code:
Me.Text26 = IIf(Me.Text22 Mod 5 = 0, Me.Text22, 5 - (Me.Text22 Mod 5) + Me.Text22)
Linq ;0)>
 
Thanks, Guys!!!

Ling's code worked perfectly. :):)

Out of curiosity any way for that code to be modified slightly so that if the entered number in text22 that text26 would go up to the next division of 5.

For example: I enter 5 into [text22] and then [text26] goes rounds up to 10.

Thanks
Kathie
 

Users who are viewing this thread

Back
Top Bottom