W
Wendymel
Hello,
I submitted a question in June (6/24/2009) concerning formatting a percent
field. It was resolved and has worked ever since. Until last week, when we
upgraded to Access 2007.
Here is the original question:
-------------------------------------------------------
"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. "
---------------------------------------------------------------------------
And here is the resolution:
---------------------------------------------------------------------------
From the sound of it, your field size (in the table design) is set to Long
Integer, or maybe Integer or Byte. These are whole-number types, and so
can't hold fractional values. Change the field size to Single or Double.
These are floating types, which are suitable for the Percent format.
--
Dirk Goldgar, MS Access MVP
www.datagnostics.com
--------------------------------------------------------------------------
The problem has returned and I am not sure what to do to correct it.
Please help!.....again.
Wendy
I submitted a question in June (6/24/2009) concerning formatting a percent
field. It was resolved and has worked ever since. Until last week, when we
upgraded to Access 2007.
Here is the original question:
-------------------------------------------------------
"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. "
---------------------------------------------------------------------------
And here is the resolution:
---------------------------------------------------------------------------
From the sound of it, your field size (in the table design) is set to Long
Integer, or maybe Integer or Byte. These are whole-number types, and so
can't hold fractional values. Change the field size to Single or Double.
These are floating types, which are suitable for the Percent format.
--
Dirk Goldgar, MS Access MVP
www.datagnostics.com
--------------------------------------------------------------------------
The problem has returned and I am not sure what to do to correct it.
Please help!.....again.
Wendy