Format - listbox

ManuNeko

Registered User.
Local time
Today, 16:29
Joined
Aug 23, 2006
Messages
31
I have a listbox with 3 columns: Date, Shop, Amount

I want to format the amount and have it right aligned.

Can anyone tell me how to do that?
 
I'm not sure, but does 'reading order' in the properties work?
 
No that does not work.
 
if its a currency field, it should be formatted correctly already. where does the data come from?
 
I fill the listbox in the Load event of the form and the onclick event of both the listbox (with the months) and the combobox (with the years).

I use "Format" in my Sql-statement and it does format my field, but it is right aligned and not left aligned.

This is the sql-statement I use:
Code:
cSqlStatement = "SELECT Budget.ID, Budget.Date AS Datum, Store.Name AS Van, Format(Budget.[Out], '#,###,###,##0.00') AS Bedrag FROM Budget LEFT JOIN Store ON Budget.StoreID = Store.ID WHERE (((Budget.[Out]) > 0)) "
cSqlStatement = cSqlStatement & "AND Month(Budget.Date) = " & lstMaand.Value & " AND Year(Budget.Date) = " & cboJaar.Value
cSqlStatement = cSqlStatement & " ORDER BY Budget.Date, Store.Name;"
lstUitgaven.RowSource = cSqlStatement

I also included a printscreen of my form so you can see what I mean
frmOverzicht.gif
 
so its budget.out thats the problem is it? is that formatted as currency in the dbs table. if so, this should format correctly in the list box, I think.
 
I've had a look now, and I see what you mean. I just assumed it should format correctly according to the base type of any field. but it seems to format any column left aligned, so I guess thats just intrinsic and not changeable.
 
Thanks.

Do you know how I can fill in the fields on the top? At the moment they are just constants. I tried with a query that had a sum in it; but that didn't work.
 
i think you need a totals query to get at those and then take the values from the totals query. I generally use stored queries, but I'm sure you can use SQL directly.
 
get a select query that has the items you want to see, then click the sigma (totals) button in the icon bar. the query will change to a totals query. it will group your data by repeating sets of data. in the value column, change the grouby by to sum, or count, or max etc, and see what happens.
 
I have a query with a sum in. But my problem is how do I connect this query to the textbox?
 

Users who are viewing this thread

Back
Top Bottom