PC Review


Reply
Thread Tools Rate Thread

Commas in list box items

 
 
=?Utf-8?B?QW5keSBEb3JwaA==?=
Guest
Posts: n/a
 
      15th Feb 2005
I am populating a list box from values in a table. One of the table values,
a text field, may or may not contain commas (,). When a comma is
encountered, the list box acts as if it is a semi-colon (, treating the
comma as a delimiter. Is there a workaround?

Thanks in advance
 
Reply With Quote
 
 
 
 
David C. Holley
Guest
Posts: n/a
 
      15th Feb 2005
How are you populting the list box? Are you populating it from a
Table/Query? Commas in a field value are possible.

David H

Andy Dorph wrote:
> I am populating a list box from values in a table. One of the table values,
> a text field, may or may not contain commas (,). When a comma is
> encountered, the list box acts as if it is a semi-colon (, treating the
> comma as a delimiter. Is there a workaround?
>
> Thanks in advance

 
Reply With Quote
 
=?Utf-8?B?QW5keSBEb3JwaA==?=
Guest
Posts: n/a
 
      15th Feb 2005
I am using a table, running a SELECT query and populating it from the
recordset using the AddItem method.

"David C. Holley" wrote:

> How are you populting the list box? Are you populating it from a
> Table/Query? Commas in a field value are possible.
>
> David H
>
> Andy Dorph wrote:
> > I am populating a list box from values in a table. One of the table values,
> > a text field, may or may not contain commas (,). When a comma is
> > encountered, the list box acts as if it is a semi-colon (, treating the
> > comma as a delimiter. Is there a workaround?
> >
> > Thanks in advance

>

 
Reply With Quote
 
Alex Dybenko
Guest
Posts: n/a
 
      15th Feb 2005
why not to bind query directly to combobox? set rowsource type to
Table/Query and row source to your query

--
Alex Dybenko (MVP)
http://Alex.Dybenko.com
http://www.PointLtd.com


"Andy Dorph" <(E-Mail Removed)> wrote in message
news:89983A2A-891A-4A8D-AB41-(E-Mail Removed)...
>I am using a table, running a SELECT query and populating it from the
> recordset using the AddItem method.
>
> "David C. Holley" wrote:
>
>> How are you populting the list box? Are you populating it from a
>> Table/Query? Commas in a field value are possible.
>>
>> David H
>>
>> Andy Dorph wrote:
>> > I am populating a list box from values in a table. One of the table
>> > values,
>> > a text field, may or may not contain commas (,). When a comma is
>> > encountered, the list box acts as if it is a semi-colon (, treating
>> > the
>> > comma as a delimiter. Is there a workaround?
>> >
>> > Thanks in advance

>>



 
Reply With Quote
 
David C. Holley
Guest
Posts: n/a
 
      15th Feb 2005
If there's no special logic that you're exerting on the field values
using VBA, change the RowSourceType to Table/Query and set the RowSource
to the Query.

David H

Andy Dorph wrote:
> I am using a table, running a SELECT query and populating it from the
> recordset using the AddItem method.
>
> "David C. Holley" wrote:
>
>
>>How are you populting the list box? Are you populating it from a
>>Table/Query? Commas in a field value are possible.
>>
>>David H
>>
>>Andy Dorph wrote:
>>
>>>I am populating a list box from values in a table. One of the table values,
>>>a text field, may or may not contain commas (,). When a comma is
>>>encountered, the list box acts as if it is a semi-colon (, treating the
>>>comma as a delimiter. Is there a workaround?
>>>
>>>Thanks in advance

>>

 
Reply With Quote
 
=?Utf-8?B?QW5keSBEb3JwaA==?=
Guest
Posts: n/a
 
      15th Feb 2005
Alex:

I need to customize the list box. The only problem I have is when the text
contains a comma. It is then treated as a delimiter. All I am looking for
is an easy workaround, if possible. I have to use List Values as my
rowsource type to be able to add the custom selection(s), so binding it to a
table/query is not feasible.

Spaseeba.

"Alex Dybenko" wrote:

> why not to bind query directly to combobox? set rowsource type to
> Table/Query and row source to your query
>
> --
> Alex Dybenko (MVP)
> http://Alex.Dybenko.com
> http://www.PointLtd.com
>
>
> "Andy Dorph" <(E-Mail Removed)> wrote in message
> news:89983A2A-891A-4A8D-AB41-(E-Mail Removed)...
> >I am using a table, running a SELECT query and populating it from the
> > recordset using the AddItem method.
> >
> > "David C. Holley" wrote:
> >
> >> How are you populting the list box? Are you populating it from a
> >> Table/Query? Commas in a field value are possible.
> >>
> >> David H
> >>
> >> Andy Dorph wrote:
> >> > I am populating a list box from values in a table. One of the table
> >> > values,
> >> > a text field, may or may not contain commas (,). When a comma is
> >> > encountered, the list box acts as if it is a semi-colon (, treating
> >> > the
> >> > comma as a delimiter. Is there a workaround?
> >> >
> >> > Thanks in advance
> >>

>
>
>

 
Reply With Quote
 
David C. Holley
Guest
Posts: n/a
 
      15th Feb 2005
Could you please elaborate on how you need to customize the list box?
More likely than not the customization is possible at the query level.

David H

Andy Dorph wrote:
> Alex:
>
> I need to customize the list box. The only problem I have is when the text
> contains a comma. It is then treated as a delimiter. All I am looking for
> is an easy workaround, if possible. I have to use List Values as my
> rowsource type to be able to add the custom selection(s), so binding it to a
> table/query is not feasible.
>
> Spaseeba.
>
> "Alex Dybenko" wrote:
>
>
>>why not to bind query directly to combobox? set rowsource type to
>>Table/Query and row source to your query
>>
>>--
>>Alex Dybenko (MVP)
>>http://Alex.Dybenko.com
>>http://www.PointLtd.com
>>
>>
>>"Andy Dorph" <(E-Mail Removed)> wrote in message
>>news:89983A2A-891A-4A8D-AB41-(E-Mail Removed)...
>>
>>>I am using a table, running a SELECT query and populating it from the
>>>recordset using the AddItem method.
>>>
>>>"David C. Holley" wrote:
>>>
>>>
>>>>How are you populting the list box? Are you populating it from a
>>>>Table/Query? Commas in a field value are possible.
>>>>
>>>>David H
>>>>
>>>>Andy Dorph wrote:
>>>>
>>>>>I am populating a list box from values in a table. One of the table
>>>>>values,
>>>>>a text field, may or may not contain commas (,). When a comma is
>>>>>encountered, the list box acts as if it is a semi-colon (, treating
>>>>>the
>>>>>comma as a delimiter. Is there a workaround?
>>>>>
>>>>>Thanks in advance
>>>>

>>
>>

 
Reply With Quote
 
John Nurick
Guest
Posts: n/a
 
      15th Feb 2005
Hi Andy,

Have you tried enclosing the values in quotes?

"first";"second,comma";"third"

On Tue, 15 Feb 2005 06:11:06 -0800, "Andy Dorph"
<(E-Mail Removed)> wrote:

>I am populating a list box from values in a table. One of the table values,
>a text field, may or may not contain commas (,). When a comma is
>encountered, the list box acts as if it is a semi-colon (, treating the
>comma as a delimiter. Is there a workaround?
>
>Thanks in advance


--
John Nurick [Microsoft Access MVP]

Please respond in the newgroup and not by email.
 
Reply With Quote
 
=?Utf-8?B?QW5keSBEb3JwaA==?=
Guest
Posts: n/a
 
      16th Feb 2005
John:

Thanks for your suggestion. I had read that suggestion under another thread
and had tried it with no success.

"John Nurick" wrote:

> Hi Andy,
>
> Have you tried enclosing the values in quotes?
>
> "first";"second,comma";"third"
>
> On Tue, 15 Feb 2005 06:11:06 -0800, "Andy Dorph"
> <(E-Mail Removed)> wrote:
>
> >I am populating a list box from values in a table. One of the table values,
> >a text field, may or may not contain commas (,). When a comma is
> >encountered, the list box acts as if it is a semi-colon (, treating the
> >comma as a delimiter. Is there a workaround?
> >
> >Thanks in advance

>
> --
> John Nurick [Microsoft Access MVP]
>
> Please respond in the newgroup and not by email.
>

 
Reply With Quote
 
John Nurick
Guest
Posts: n/a
 
      16th Feb 2005
Curious. It works when I try it (Access 2003, Win XP, regional settings
English UK). This is pasted from one of my comboboxes' RowSource
property:
"test";"with; colon";"with, comma";"without";unquoted
and it displays as
test
with; colon
with, commma
without
unquoted

Alternatives: as David H suggests, write a query to customise the list
contents; or write code that strips out the commas. Possibly you could
substitute "‚" the "single low-9 quotation mark", which is at 0x082 in
western European character sets, or U+201A in Unicode.

On Wed, 16 Feb 2005 03:03:03 -0800, "Andy Dorph"
<(E-Mail Removed)> wrote:

>John:
>
>Thanks for your suggestion. I had read that suggestion under another thread
>and had tried it with no success.
>
>"John Nurick" wrote:
>
>> Hi Andy,
>>
>> Have you tried enclosing the values in quotes?
>>
>> "first";"second,comma";"third"
>>
>> On Tue, 15 Feb 2005 06:11:06 -0800, "Andy Dorph"
>> <(E-Mail Removed)> wrote:
>>
>> >I am populating a list box from values in a table. One of the table values,
>> >a text field, may or may not contain commas (,). When a comma is
>> >encountered, the list box acts as if it is a semi-colon (, treating the
>> >comma as a delimiter. Is there a workaround?
>> >
>> >Thanks in advance

>>
>> --
>> John Nurick [Microsoft Access MVP]
>>
>> Please respond in the newgroup and not by email.
>>


--
John Nurick [Microsoft Access MVP]

Please respond in the newgroup and not by email.
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Code to add items to list to deal with commas in value... Fred Boer Microsoft Outlook VBA Programming 1 25th Jun 2009 02:50 AM
Inverted commas around email addresses in sent items - Outlook 200 Dee Microsoft Outlook Discussion 0 5th Mar 2009 03:58 AM
How do I de-concatenate items separated by commas! Taneli Hanhivaara Microsoft Excel Misc 2 15th Dec 2008 11:45 AM
What is the 'appropriate' way to list items...with commas or semicolons? kdreger@gmail.com Microsoft Word Document Management 5 26th May 2006 05:00 PM
Deleting items without commas at end =?Utf-8?B?ZmF4eWxhZHk=?= Microsoft Access Queries 2 6th Oct 2004 12:47 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:08 PM.