Connecting Tech Pros Worldwide Help | Site Map

List box decimal places

  #1  
Old November 13th, 2005, 06:22 AM
Hank
Guest
 
Posts: n/a
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

  #2  
Old November 13th, 2005, 06:24 AM
David Schofield
Guest
 
Posts: n/a

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

  #3  
Old November 13th, 2005, 06:24 AM
Hank
Guest
 
Posts: n/a

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Find out number of decimal places mattlightbourn answers 3 September 26th, 2007 12:07 AM
Wierd Combo Box Behaviour! RamanS answers 2 July 19th, 2007 02:30 PM
Combo Box "Not In List" VBA code to Add item to table Bob Alston answers 9 November 13th, 2005 04:04 PM
comp.lang.c Answers to Frequently Asked Questions (FAQ List) Steve Summit answers 0 November 13th, 2005 03:15 AM