Link to home
Create AccountLog in
Avatar of johnhardy
johnhardyFlag for United Kingdom of Great Britain and Northern Ireland

asked on

access percentage field

I have created a percentage field in access.mdb
I have used
Double
Percent
Decimal places 2
I have a default value of 5 where I expected to see 5% or perhaps .05 but in fact it shows 500%
Can anyone say what I am doing wrong please?
Thanks John
ASKER CERTIFIED SOLUTION
Avatar of frankytee
frankytee
Flag of Australia image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
SOLUTION
Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
it looks as though the percent format means you'll have to enter the value as a decimal "fraction" value out of 1, as Acces will then internally multiple by 100 to get the result as a percentage value.
so a value of 1 = 1* 100 = 100%,
0.05 = 0.05 * 100 = 5% etc
Avatar of johnhardy

ASKER

Thanks
I agree but if someone enters 5% in a field on a form they will expect the percentage to be 5% not 500% some very large commissions could be payable.
Perhaps its better  just to keep the field as a number. Any thought please?
Yes, there is a work-around. When u enter a value in that field, suffix it with a % symbol i.e. enter it as 5% and not just 5.
i would create it as simple numeric field with a % label on your form. but then you would need to divide that field by 100 when you do your calculations etc
or the other option is to retain the % field and get your user to enter the value as a number in an unbound textbox in your form and after applying whatever validation, divide it by 100 and set the result to the real (percent) field.
Sorry, i submitted the previous post without completing it - Entering the value as xx% for that field (which is defined as Percent) implies that the entered value is itself a % and so Access does not multiply it by 100 internally.
Thanks for the help I am doing this via an asp form submission so I will keep it simple and revert to a numeric field.
KISS priciple very good!
John