Solved

Format ListBox columns

Posted on 2013-01-31
5
501 Views
Last Modified: 2013-02-04
How would I code in VBA from MS Access 2003 so that My values in Column(5) and Column(6) display as 0.00?

In my SQL I'm outputting this to the listbox
LB
This is my listbox as it displays right now
I want the 40.00 displayed etc...
cp2
0
Comment
Question by:lrbrister
  • 2
  • 2
5 Comments
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 38841648
what is the rowsource?
0
 

Author Comment

by:lrbrister
ID: 38841669
capricorn1
The recordsource is from a stored procedure
ADODB.recordset
0
 
LVL 49

Accepted Solution

by:
Gustav Brock earned 500 total points
ID: 38843203
The listbox always displays text.
You will have to adjust the stored procedure to produce the formatted output as strings as Format would do:

  Format(40, "0.00") => 40.00

/gustav
0
 

Author Closing Comment

by:lrbrister
ID: 38851024
Thanks
0
 
LVL 49

Expert Comment

by:Gustav Brock
ID: 38851125
You are welcome!

/gustav
0

Featured Post

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The new Microsoft OS looks great, is easier than ever to upgrade to, it is even free.  So what's the catch?  If you don't change the privacy settings, Microsoft will, in accordance with the (EULA) you clicked okay to without reading, collect all the…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question