Connecting Tech Pros Worldwide Help | Site Map

List box decimal places

Hank
Guest
 
Posts: n/a
#1: Nov 13 '05
Hello,
I am displaying numerical (single) values from a table into a
list box using Access 2000. Although the format in the table is for
three decimal places, the list box rounds all the columns to two
decimal places. I do not know how to format the numbers in the list
box as the Format parameter has more to do with spacing.
Thanks,
Hank Reed

David Schofield
Guest
 
Posts: n/a
#2: Nov 13 '05

re: List box decimal places


On 15 Dec 2004 03:18:50 -0800, "Hank" <hankrunner@aol.com> wrote:
[color=blue]
>Hello,
>I am displaying numerical (single) values from a table into a
>list box using Access 2000. Although the format in the table is for
>three decimal places, the list box rounds all the columns to two
>decimal places. I do not know how to format the numbers in the list
>box as the Format parameter has more to do with spacing.
>Thanks,
>Hank Reed
>[/color]
Hi
Yes, how odd!
You will have to put an explicit format function in the rowsource of
the list box, eg
SELECT DISTINCTROW format([Table1].[test], "#.000") FROM [Table1];
David

Hank
Guest
 
Posts: n/a
#3: Nov 13 '05

re: List box decimal places


David Schofield wrote:[color=blue]
> On 15 Dec 2004 03:18:50 -0800, "Hank" <hankrunner@aol.com> wrote:
>
> Hi
> Yes, how odd!
> You will have to put an explicit format function in the rowsource of
> the list box, eg
> SELECT DISTINCTROW format([Table1].[test], "#.000") FROM [Table1];
> David[/color]

Hi David,
Thanks for the tip. I had actually tried the format approach myself
and could not make it work. In fact when I put it into the SQL
statement, the whole line turned red - meaning, of course, bad syntax.
Then I realized I had quotes inside of quotes. I always build a string
first so I can view the completed statement, during debug, before
assigning the rowsource, et cetera. This is the proper form if you are
building an SQL string:

strSQL1 = "SELECT Format([Table1].[test], '#.000') FROM [Table1];"
Me.ParameterList.RowSource = strSQL1
Note the single quotes in the Format spec.
Thanks again,
Hank Reed

Closed Thread