Discussion:
Percent Format 10% shows 1000%
(too old to reply)
geeves1293
2009-09-14 19:44:01 UTC
Permalink
Hi all,

I've got a field as number - percent - 0 decimal - double.

When I enter 10 and tab on it changes to 1000% not the expected 10%.

Anybody know why this is?

Thanks

Geeves1293
John Spencer
2009-09-14 20:36:44 UTC
Permalink
Simple
.10 is 10 percent
10 is 10 * 100 percent or 1000 percent

Percent format just show the number as percentage points.

John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
Post by geeves1293
Hi all,
I've got a field as number - percent - 0 decimal - double.
When I enter 10 and tab on it changes to 1000% not the expected 10%.
Anybody know why this is?
Thanks
Geeves1293
geeves1293
2009-09-14 21:34:01 UTC
Permalink
Simple yes, but a bit annoying when having to put .1 instead of 10 to get
what i want.
I'm going to have to put a comment on field for other users on how to put
10% in field.

Thanks

geeves1293
Post by John Spencer
Simple
.10 is 10 percent
10 is 10 * 100 percent or 1000 percent
Percent format just show the number as percentage points.
John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
Post by geeves1293
Hi all,
I've got a field as number - percent - 0 decimal - double.
When I enter 10 and tab on it changes to 1000% not the expected 10%.
Anybody know why this is?
Thanks
Geeves1293
Duane Hookom
2009-09-14 21:51:01 UTC
Permalink
You could add some code to the After Update event of the text box like:

If Me.txtYourTBoxName > 1 Then
Me.txtYourTBoxName = Me.txtYourTBoxName /100
End If
--
Duane Hookom
Microsoft Access MVP
Post by geeves1293
Simple yes, but a bit annoying when having to put .1 instead of 10 to get
what i want.
I'm going to have to put a comment on field for other users on how to put
10% in field.
Thanks
geeves1293
Post by John Spencer
Simple
.10 is 10 percent
10 is 10 * 100 percent or 1000 percent
Percent format just show the number as percentage points.
John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
Post by geeves1293
Hi all,
I've got a field as number - percent - 0 decimal - double.
When I enter 10 and tab on it changes to 1000% not the expected 10%.
Anybody know why this is?
Thanks
Geeves1293
geeves1293
2009-09-14 22:20:02 UTC
Permalink
Thanks for help

Im putting =[fldDISCOUNT] / 100 in the after update text box for this field
on the form.

I couldn't get anything to change. I tried your Iif function and got the
same result.

The structure is quite simple.
unit price - discount * qty on a subform datasheet view.

Is there something i'm missing somewhere?

Thanks again

geeves1293
Post by Duane Hookom
If Me.txtYourTBoxName > 1 Then
Me.txtYourTBoxName = Me.txtYourTBoxName /100
End If
--
Duane Hookom
Microsoft Access MVP
Post by geeves1293
Simple yes, but a bit annoying when having to put .1 instead of 10 to get
what i want.
I'm going to have to put a comment on field for other users on how to put
10% in field.
Thanks
geeves1293
Post by John Spencer
Simple
.10 is 10 percent
10 is 10 * 100 percent or 1000 percent
Percent format just show the number as percentage points.
John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
Post by geeves1293
Hi all,
I've got a field as number - percent - 0 decimal - double.
When I enter 10 and tab on it changes to 1000% not the expected 10%.
Anybody know why this is?
Thanks
Geeves1293
Duane Hookom
2009-09-14 22:46:09 UTC
Permalink
I'm not sure where you entered the code I suggested. It should be in the code
window, not the property. Also, my code used "If" not "IIf"
--
Duane Hookom
Microsoft Access MVP
Post by geeves1293
Thanks for help
Im putting =[fldDISCOUNT] / 100 in the after update text box for this field
on the form.
I couldn't get anything to change. I tried your Iif function and got the
same result.
The structure is quite simple.
unit price - discount * qty on a subform datasheet view.
Is there something i'm missing somewhere?
Thanks again
geeves1293
Post by Duane Hookom
If Me.txtYourTBoxName > 1 Then
Me.txtYourTBoxName = Me.txtYourTBoxName /100
End If
--
Duane Hookom
Microsoft Access MVP
Post by geeves1293
Simple yes, but a bit annoying when having to put .1 instead of 10 to get
what i want.
I'm going to have to put a comment on field for other users on how to put
10% in field.
Thanks
geeves1293
Post by John Spencer
Simple
.10 is 10 percent
10 is 10 * 100 percent or 1000 percent
Percent format just show the number as percentage points.
John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
Post by geeves1293
Hi all,
I've got a field as number - percent - 0 decimal - double.
When I enter 10 and tab on it changes to 1000% not the expected 10%.
Anybody know why this is?
Thanks
Geeves1293
geeves1293
2009-09-15 11:07:02 UTC
Permalink
Oh, I put it into the property window in form design view.

Code? Is that a new module (at the bottom of database window)?

Your following code includes Me.txtYourTBoxName. Do I replace all of that
with my fldDISCOUNT.

Thanks

Graham
Post by Duane Hookom
I'm not sure where you entered the code I suggested. It should be in the code
window, not the property. Also, my code used "If" not "IIf"
--
Duane Hookom
Microsoft Access MVP
Post by geeves1293
Thanks for help
Im putting =[fldDISCOUNT] / 100 in the after update text box for this field
on the form.
I couldn't get anything to change. I tried your Iif function and got the
same result.
The structure is quite simple.
unit price - discount * qty on a subform datasheet view.
Is there something i'm missing somewhere?
Thanks again
geeves1293
Post by Duane Hookom
If Me.txtYourTBoxName > 1 Then
Me.txtYourTBoxName = Me.txtYourTBoxName /100
End If
--
Duane Hookom
Microsoft Access MVP
Post by geeves1293
Simple yes, but a bit annoying when having to put .1 instead of 10 to get
what i want.
I'm going to have to put a comment on field for other users on how to put
10% in field.
Thanks
geeves1293
Post by John Spencer
Simple
.10 is 10 percent
10 is 10 * 100 percent or 1000 percent
Percent format just show the number as percentage points.
John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
Post by geeves1293
Hi all,
I've got a field as number - percent - 0 decimal - double.
When I enter 10 and tab on it changes to 1000% not the expected 10%.
Anybody know why this is?
Thanks
Geeves1293
Duane Hookom
2009-09-15 12:22:02 UTC
Permalink
My suggestion used the code/vba/module window. You would replace
"txtYourTBoxName" with your actual text box name.
--
Duane Hookom
Microsoft Access MVP
Post by geeves1293
Oh, I put it into the property window in form design view.
Code? Is that a new module (at the bottom of database window)?
Your following code includes Me.txtYourTBoxName. Do I replace all of that
with my fldDISCOUNT.
Thanks
Graham
Post by Duane Hookom
I'm not sure where you entered the code I suggested. It should be in the code
window, not the property. Also, my code used "If" not "IIf"
--
Duane Hookom
Microsoft Access MVP
Post by geeves1293
Thanks for help
Im putting =[fldDISCOUNT] / 100 in the after update text box for this field
on the form.
I couldn't get anything to change. I tried your Iif function and got the
same result.
The structure is quite simple.
unit price - discount * qty on a subform datasheet view.
Is there something i'm missing somewhere?
Thanks again
geeves1293
Post by Duane Hookom
If Me.txtYourTBoxName > 1 Then
Me.txtYourTBoxName = Me.txtYourTBoxName /100
End If
--
Duane Hookom
Microsoft Access MVP
Post by geeves1293
Simple yes, but a bit annoying when having to put .1 instead of 10 to get
what i want.
I'm going to have to put a comment on field for other users on how to put
10% in field.
Thanks
geeves1293
Post by John Spencer
Simple
.10 is 10 percent
10 is 10 * 100 percent or 1000 percent
Percent format just show the number as percentage points.
John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
Post by geeves1293
Hi all,
I've got a field as number - percent - 0 decimal - double.
When I enter 10 and tab on it changes to 1000% not the expected 10%.
Anybody know why this is?
Thanks
Geeves1293
geeves1293
2009-09-15 19:14:01 UTC
Permalink
I cannot seem to get this to work.

I opened a new module and pasted (with the field name change) your code into
it.

How does access know when I use that field to use the code.

Thanks again
Graham
Post by Duane Hookom
My suggestion used the code/vba/module window. You would replace
"txtYourTBoxName" with your actual text box name.
--
Duane Hookom
Microsoft Access MVP
Post by geeves1293
Oh, I put it into the property window in form design view.
Code? Is that a new module (at the bottom of database window)?
Your following code includes Me.txtYourTBoxName. Do I replace all of that
with my fldDISCOUNT.
Thanks
Graham
Post by Duane Hookom
I'm not sure where you entered the code I suggested. It should be in the code
window, not the property. Also, my code used "If" not "IIf"
--
Duane Hookom
Microsoft Access MVP
Post by geeves1293
Thanks for help
Im putting =[fldDISCOUNT] / 100 in the after update text box for this field
on the form.
I couldn't get anything to change. I tried your Iif function and got the
same result.
The structure is quite simple.
unit price - discount * qty on a subform datasheet view.
Is there something i'm missing somewhere?
Thanks again
geeves1293
Post by Duane Hookom
If Me.txtYourTBoxName > 1 Then
Me.txtYourTBoxName = Me.txtYourTBoxName /100
End If
--
Duane Hookom
Microsoft Access MVP
Post by geeves1293
Simple yes, but a bit annoying when having to put .1 instead of 10 to get
what i want.
I'm going to have to put a comment on field for other users on how to put
10% in field.
Thanks
geeves1293
Post by John Spencer
Simple
.10 is 10 percent
10 is 10 * 100 percent or 1000 percent
Percent format just show the number as percentage points.
John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
Post by geeves1293
Hi all,
I've got a field as number - percent - 0 decimal - double.
When I enter 10 and tab on it changes to 1000% not the expected 10%.
Anybody know why this is?
Thanks
Geeves1293
Fred
2009-09-15 12:50:03 UTC
Permalink
IMHO yo are going through a lot of work to make two wrongs = a right.

If I understand your requirement properly, just make your PercentDiscout
field a simple numeric field (not %) and have the user enter the percent.
Just have the displays of that field add a % sign after it (e.g. using format
function)

And have your discount equations do the math appropriately. For example
(unitPrice * (1-PerCentDiscount/100))*quantity = total sell price
geeves1293
2009-09-15 19:11:01 UTC
Permalink
In the table the field name "fldDISCOUNT" has a number datatype and is
formatted with percentage and size set to single.

I think that is what you have stated to do, but still no luck.

Graham
Post by Fred
IMHO yo are going through a lot of work to make two wrongs = a right.
If I understand your requirement properly, just make your PercentDiscout
field a simple numeric field (not %) and have the user enter the percent.
Just have the displays of that field add a % sign after it (e.g. using format
function)
And have your discount equations do the math appropriately. For example
(unitPrice * (1-PerCentDiscount/100))*quantity = total sell price
Continue reading on narkive:
Loading...