using MROUND function in reports

A

a.m.sullivan

I am trying to use the mround function in an access
report. The function is not listed in the expression
builder box of built in functions. When I use the
calculation, for example, =mround([AmountDue],0.05), and
run the report, it asks for a parameter mround. After
inputing a number, it returns to the design view and I am
unable to exit - message about reseting current code in
break mode - doesn't accept yes or no.
How can I correctly use this function?
Thanks
Annette
 
A

Allen Browne

What is mround()?

In Access 2000 and later, there is a built-in Round() function, but mround()
is not part of Access.

If it is a custom function, you may be supplying an argument incorrectly.
Press Ctrl+G to open the Immediate window.
Test it there, by entering something like this:
? mround(999.999, 0.05)

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

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

message
news:[email protected]...
 
A

a.m.sullivan

Mround is an Excel function. Specifically, I am trying to
use it to round amounts on invoices to the nearest 5
cents.

The Excel help states that "MROUND rounds up, away from
zero, if the remainder of dividing number by multiple is
greater than or equal to half the value of multiple."

If I cannot use this function in Access, what function
can I use to round the totals to the nearest 5 cents?

Thanks
-----Original Message-----
What is mround()?

In Access 2000 and later, there is a built-in Round() function, but mround()
is not part of Access.

If it is a custom function, you may be supplying an argument incorrectly.
Press Ctrl+G to open the Immediate window.
Test it there, by entering something like this:
? mround(999.999, 0.05)

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

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

"(e-mail address removed)"
message
I am trying to use the mround function in an access
report. The function is not listed in the expression
builder box of built in functions. When I use the
calculation, for example, =mround([AmountDue],0.05), and
run the report, it asks for a parameter mround. After
inputing a number, it returns to the design view and I am
unable to exit - message about reseting current code in
break mode - doesn't accept yes or no.
How can I correctly use this function?
Thanks
Annette


.
 
A

Allen Browne

Function Round05(varAmount)
' Purpose: Return a variant of type Currency to nearest 5c.
If IsError(varAmount) Then
Round05 = Null
Else
If IsNumeric(varAmount) Then
Round05 = CCur(Int(CDec(varAmount) * 20 + 0.5) / 20)
Else
Round05 = varAmount
End If
End If
End Function

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

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

Mround is an Excel function. Specifically, I am trying to
use it to round amounts on invoices to the nearest 5
cents.

The Excel help states that "MROUND rounds up, away from
zero, if the remainder of dividing number by multiple is
greater than or equal to half the value of multiple."

If I cannot use this function in Access, what function
can I use to round the totals to the nearest 5 cents?

Thanks
-----Original Message-----
What is mround()?

In Access 2000 and later, there is a built-in Round() function, but mround()
is not part of Access.

If it is a custom function, you may be supplying an argument incorrectly.
Press Ctrl+G to open the Immediate window.
Test it there, by entering something like this:
? mround(999.999, 0.05)


"(e-mail address removed)"
message
I am trying to use the mround function in an access
report. The function is not listed in the expression
builder box of built in functions. When I use the
calculation, for example, =mround([AmountDue],0.05), and
run the report, it asks for a parameter mround. After
inputing a number, it returns to the design view and I am
unable to exit - message about reseting current code in
break mode - doesn't accept yes or no.
How can I correctly use this function?
Thanks
Annette
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top