$#,###.## format in a List Box

  • Thread starter Thread starter Bob V
  • Start date Start date
B

Bob V

My list box is showing 1234.6789 When It should be showing $1,234.67 can I
format my list box, my query that is showing the correct format
Thanks for any Help....Bob
 
My list box is showing 1234.6789 When It should be showing $1,234.67 can I
format my list box, my query that is showing the correct format
Thanks for any Help....Bob

Put a calculated field in the query using the Format() Function:

ShowNum: Format([yourfield], "Currency")
or
ShowNum: Format([yourfield], "$#,###.00")

and display this field in the listbox. If it's also the bound column, leave
both the unformatted and the formatted one - make the Format() value the
visible column and the unformatted one the bound column.

John W. Vinson [MVP]
 
Thanks John.....Bob

John W. Vinson said:
My list box is showing 1234.6789 When It should be showing $1,234.67 can I
format my list box, my query that is showing the correct format
Thanks for any Help....Bob

Put a calculated field in the query using the Format() Function:

ShowNum: Format([yourfield], "Currency")
or
ShowNum: Format([yourfield], "$#,###.00")

and display this field in the listbox. If it's also the bound column,
leave
both the unformatted and the formatted one - make the Format() value the
visible column and the unformatted one the bound column.

John W. Vinson [MVP]
 
My list box is showing 1234.6789 When It should be showing $1,234.67 can I
format my list box, my query that is showing the correct format

Put a calculated field in the query using the Format() Function:

ShowNum: Format([yourfield], "Currency")
or
ShowNum: Format([yourfield], "$#,###.00")

Assuming the data in question is of type CURRENCY, your suggestion
will not return the OP's desired result e.g.

SELECT CCUR(1234.6789) AS test_value,
Format(test_value, '$#,###.00') AS result_text

returns '$1,234.68' whereas the OP wanted it to end in '.67'.

The Format() expression (not 'Function' <g>) exhibits symmetric
rounding i.e. 0.5 always rounds away from zero. The OP hasn't stated
which rounding algorithm but it's not banker's rounding either, most
often associated with monetary amounts e.g.

SELECT CCUR(1234.6789) AS test_value,
ROUND(test_value, 2) as result_value

returns 1234.68, noting that the Round() expression exhibits banker's
rounding.

I would suggest the OP takes a look at this KB article:

How To Implement Custom Rounding Procedures
http://support.microsoft.com/kb/196652

to find a recognized name for their rounding algorithm then search
these groups' archives for a suitable Jet expression.

Jamie.

--
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

List Box Formatting 3
Windows 10 New Win 10 File Explorer 2
MS Access problem 0
Format List Box! 1
conditional formatting in a list box - 2009 2
List Box Synch 5
Show all Records 1
List Box format Question 3

Back
Top