dbTalk Databases Forums  

Adding item to listbox

comp.database.ms-access comp.database.ms-access


Discuss Adding item to listbox in the comp.database.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Ramesh Kumar Bhandari
 
Posts: n/a

Default Adding item to listbox - 08-15-2004 , 02:59 AM






Hi all,
How can I add an item in a listbox control when the item has a comma
in it? The code, me.list1.addItem("Price for item 1") works just fine.
However, when I use the code, me.list1.addItem("Prices for items 1, 2
and 3"), the item gets truncated, and two items, "Prices for items 1",
and " 2 and 3" are added instead. I want to add only one item, "Prices
for items 1, 2 and 3". What code should I have to use? Any kind help
is appreciated.

Thanks.
Ramesh

Reply With Quote
  #2  
Old   
Wes
 
Posts: n/a

Default Re: Adding item to listbox - 08-18-2004 , 08:07 PM






Add single quotes to your code.

me.list1.addItem("'Prices for items 1, 2 and 3'")

That should fix it.

bhandaritwo (AT) yahoo (DOT) com (Ramesh Kumar Bhandari) wrote in message news:<ed1fc058.0408142359.192ecea6 (AT) posting (DOT) google.com>...
Quote:
Hi all,
How can I add an item in a listbox control when the item has a comma
in it? The code, me.list1.addItem("Price for item 1") works just fine.
However, when I use the code, me.list1.addItem("Prices for items 1, 2
and 3"), the item gets truncated, and two items, "Prices for items 1",
and " 2 and 3" are added instead. I want to add only one item, "Prices
for items 1, 2 and 3". What code should I have to use? Any kind help
is appreciated.

Thanks.
Ramesh

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.