Formatting a percent field

W

Wendymel

I am trying format a numeric field as percent. My problem is similar to the
posting "Format number field to show percent" by "Kalen" posetd on 1/23/2009.

I have a numeric field named PROJPercComp. I have formatted it as percent
with 0 decimal places.

I want the numbers entered by the user in this field to show as anything
from 1% to 100%. No decimals.

This field is used in a form called frmProjectEntry. It is bound as a source
to a text box called PercCompleted. I used the code suggested by Clifford
Bass in the above mentioned posting. It is:

If Not IsNull(controlname) And Right(controlname, 1) <> "%" Then
controlname = controlname / 100
End If

My version of the After Update code looks like:

If Not IsNull(PercCompleted) And Right(PercCompleted, 1) <> "%" Then
PercCompleted = PercCompleted / 100
End If

What is happening is that if the user enters a number of 50 or less, the
value in the field defaults to 0%. It the user enters a number of 51 to 100
then the value in the field defaults to 100%.

I just want the values to be as entered. No decimals, no rounding. If a
user enters a value of 42 then I want the field to read 42% etc.

Please help!
Thanks,

Wendy
 
W

Wendymel

Again, yet another duplicate. I had some problems posting this morning.
Please disregard this and see my first posting on this topic.

Thanks,
Wendy
 

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