How to display a comma in an unbound listbox.

C

cr113

How can I display commas in an unbound listbox?
For example if I do this:

List1.AddItem "123,456;x"
List1.AddItem "456,789;y"

It display this:

123 456
456 789

It thinks the comma is a column separator.

Is there some way to format each column maybe?
 
T

Tom van Stiphout

On Wed, 17 Mar 2010 13:15:16 -0700 (PDT), cr113 <[email protected]>
wrote:

Yes that is indeed a bit curious, because semicolon is supposed to be
the column separator. Simply wrap your values in single-quotes:
List1.AddItem "'123,456';x"

-Tom.
Microsoft Access MVP
 
C

cr113

Yes that is indeed a bit curious, because semicolon is supposed to be
the column separator. Simply wrap your values in single-quotes:
List1.AddItem "'123,456';x"

-Tom.
Microsoft Access MVP











- Show quoted text -


That worked! It also solved the problem of right justifying text. I
can pad with spaces if I wrap it with single quotes like you said.

Thanks!
 

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

Top