List Box Percentage Formatting

  • Follow


Why does a percentage formatted field in my query used for the list box show 
up as a decimal rather than a percentage?  I have the fields formatted in the 
underlying query as "Percentage" with 1 decimal.

E.G. What should be showing up as 9.4% is showing up as 0.0942212345829.

How do I fix this??
Frank
0
Reply Utf 5/13/2010 11:58:01 PM

Convert them to text:

CStr(Format([MyField] ... etc.
-- 
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.accessmvp.com
http://www.mvps.org/access


"FrankTimJr" <FrankTimJr@discussions.microsoft.com> wrote in message 
news:393FCFFB-B8AE-4227-BC09-B75FB9DF45B5@microsoft.com...
> Why does a percentage formatted field in my query used for the list box 
> show
> up as a decimal rather than a percentage?  I have the fields formatted in 
> the
> underlying query as "Percentage" with 1 decimal.
>
> E.G. What should be showing up as 9.4% is showing up as 0.0942212345829.
>
> How do I fix this??
> Frank 


0
Reply Arvin 5/14/2010 12:44:15 AM


On Thu, 13 May 2010 16:58:01 -0700, FrankTimJr
<FrankTimJr@discussions.microsoft.com> wrote:

>Why does a percentage formatted field in my query used for the list box show 
>up as a decimal rather than a percentage?  I have the fields formatted in the 
>underlying query as "Percentage" with 1 decimal.
>
>E.G. What should be showing up as 9.4% is showing up as 0.0942212345829.
>
>How do I fix this??
>Frank

That number is the actual value. 0.094 and 9.4% are just two ways of
displaying the same number! A table or query format property will not carry
over into a listbox (or an export to Word, or lots of other things).

Try putting a calculated field in the Query:

ShowPct: Format([fieldname], "Percent")

and display that calculated field in the listbox. You won't be able to do
calculations with the listbox's value if this is the bound column.
-- 

             John W. Vinson [MVP]
0
Reply John 5/14/2010 1:46:22 AM

Worked like a charm!!  Can I do the same for "Currency"?  I'll give it a shot!

Thanks again.

"John W. Vinson" wrote:

> On Thu, 13 May 2010 16:58:01 -0700, FrankTimJr
> <FrankTimJr@discussions.microsoft.com> wrote:
> 
> >Why does a percentage formatted field in my query used for the list box show 
> >up as a decimal rather than a percentage?  I have the fields formatted in the 
> >underlying query as "Percentage" with 1 decimal.
> >
> >E.G. What should be showing up as 9.4% is showing up as 0.0942212345829.
> >
> >How do I fix this??
> >Frank
> 
> That number is the actual value. 0.094 and 9.4% are just two ways of
> displaying the same number! A table or query format property will not carry
> over into a listbox (or an export to Word, or lots of other things).
> 
> Try putting a calculated field in the Query:
> 
> ShowPct: Format([fieldname], "Percent")
> 
> and display that calculated field in the listbox. You won't be able to do
> calculations with the listbox's value if this is the bound column.
> -- 
> 
>              John W. Vinson [MVP]
> .
> 
0
Reply Utf 5/14/2010 2:55:01 AM

3 Replies
821 Views

(page loaded in 0.058 seconds)

Similiar Articles:
















7/21/2012 1:55:44 AM


Reply: