Rounding Percentage

R

Robbie Doo

Is it possible to generage a MsgBox to say "The percentage is rounded to the
nearest 100" if the Sum of Percentage is 99.99% or 100.01%?
But, if the Sum of Percentage is exactly 100.00% then no msg required.

Thankx for any input.
 
E

Evi

I'm guessing that you don't want what you say you want.

If you do then, in the After Update Event of the Control that produces the
SumOfPercentage value, have

If Me.SumOfPercentage = 99.99/100 OR Me.SumOfPercentage =100.01/100 Then
MsgBox "The percentage has been rounded"
End if

You may want this same message to appear for any roundings up or down. If
all your numbers are rounded up or down then

If Me.SumOfPercentage - Int(Me.SumOfPercentage)<>0 Then
MsgBox "The percentage has been rounded to the nearest whole number"
End if
 
R

Robbie Doo

Thank you Evi...I will try your suggestion.

Evi said:
I'm guessing that you don't want what you say you want.

If you do then, in the After Update Event of the Control that produces the
SumOfPercentage value, have

If Me.SumOfPercentage = 99.99/100 OR Me.SumOfPercentage =100.01/100 Then
MsgBox "The percentage has been rounded"
End if

You may want this same message to appear for any roundings up or down. If
all your numbers are rounded up or down then

If Me.SumOfPercentage - Int(Me.SumOfPercentage)<>0 Then
MsgBox "The percentage has been rounded to the nearest whole number"
End if
 
R

Robbie Doo

Evi:

I couldn't use this for the footer of my charts. Since the Row Source comes
from a SELECT query there are no Fields for me to pick from the table for the
Footer of my chart. Thank you.
 
E

Evi

Charts? There was no mention of charts in your message.
Do you actually want a MsgBox to pop up with those words on it or do you
mean that you want a text box with this written in it?
If it's at the foot of a chart, why not just put this message into a label
as general advice. "Percentages are rounded to the nearest whole number" or
whatever you want to say, Robbie.

Evi

Have another go at explaining what you want to do
 

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