A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

List Box Percentage Formatting



 
 
Thread Tools Display Modes
  #1  
Old May 14th, 2010, 12:58 AM posted to microsoft.public.access.forms
FrankTimJr
external usenet poster
 
Posts: 18
Default List Box Percentage Formatting

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
  #2  
Old May 14th, 2010, 01:44 AM posted to microsoft.public.access.forms
Arvin Meyer [MVP][_2_]
external usenet poster
 
Posts: 2,310
Default List Box Percentage Formatting

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" wrote in message
...
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



  #3  
Old May 14th, 2010, 02:46 AM posted to microsoft.public.access.forms
John W. Vinson
external usenet poster
 
Posts: 18,261
Default List Box Percentage Formatting

On Thu, 13 May 2010 16:58:01 -0700, FrankTimJr
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]
  #4  
Old May 14th, 2010, 03:55 AM posted to microsoft.public.access.forms
FrankTimJr
external usenet poster
 
Posts: 18
Default List Box Percentage Formatting

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
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]
.

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 12:08 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.