Formatting a Listbox column

aziz rasul

Active member
Local time
Today, 15:26
Joined
Jun 26, 2000
Messages
1,935
In a table I have a numerical field called [rowcount] with

Field Size = Long Integer
Format = Standard
Decimal Places = 0

I use a query based on the table as the record source of a listbox to select some of the fields.

When I open the query, the [rowcount] column appears as it is set in the table e.g.

64,000

However in the listbox it appears as

64,000.00

How do I resolve this?
 
Have a look at the Format property of the listbox. There's a numerical formatting set.
 
Can you use the format command in the control source of the listbox? As in
Code:
=format ([rowcount],"#,##")
 
Didn't understand vbaInet?

Tried what you suggested JamesMcS, but still gave me the same result.

BTW [rowcount] is the 3rd column in the listbox.
 
Try putting it in the row source statement, sorry, not used listboxes before. So
Code:
SELECT format([rowcount],'#,##') AS Row_Count....
 
Hmm... Had a think there. A listbox doesn't have the Format property does it? But a combo box does. In that case, try casting your value to a String in your query - CStr()
 
The SELECT statement worked. Thanks.

vbaInet I tried your suggestion but no luck, but thanks for your input.
 

Users who are viewing this thread

Back
Top Bottom