Rounding up to the nearest 0.25 in Access

I would like to be able to round up to the nearest 0.25 in Access.  The number I am rounding is always positive btw.  I have searched this into the ground and thought I had an answer...but something is wrong and I have no idea what to change to make it work.  I added the following module to my database...

Function RoundToNearest(dblNumber As Double, varRoundAmount As Double, _
Optional varUp As Variant) As Double

Dim dblTemp As Double
Dim lngTemp As Long

dblTemp = dblNumber / varRoundAmount
lngTemp = CLng(dblTemp)

If lngTemp = dblTemp Then
RoundToNearest = dblNumber
If IsMissing(varUp) Then
' round up
dblTemp = lngTemp + 1
' round down
dblTemp = lngTemp
End If
RoundToNearest = dblTemp * varRoundAmount
End If
End Function

I then put the following in my query...RoundToNearest([MyNumber],0.25).

It delivers...
2.6616 as 3.00 (should be 2.75)
2.9683 as 3.25 (should be 3.00)
2.7921 as 3.00 (ok)
2.6019 as 2.75 (ok)
3.2427 as 3.50 (should be 3.25)
2 out of 5 just doesn’t work.  What do I need to change or is there another way?

Thank you in advance...this one is hurting my head!!
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Rey Obrero (Capricorn1)Commented:
round(yourNumber * 4,0)/4
Here's another formula you can try:


To get the results you specified, where the value is higher than the input number (A1 is your number)

Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

Gustav BrockCIOCommented:
This works:

dblRoundedUp = -Int(-dblValue * 4) / 4

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Tested Gustav's comment. I prefer it as a solution. My comment fails for .5 value.
KJKAccessAuthor Commented:
Thanks!  I waited way too long to ask for help.  This is awesome!!
Rey Obrero (Capricorn1)Commented:

did my post at http:#a40200811 failed your test?
KJKAccessAuthor Commented:
"Round" goes in which ever direction is closer...
So 2.76 would round to 2.75...but I need it to round up in all instances (go to 3.00 for this example)
Gustav BrockCIOCommented:
You are welcome!

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.