PC Review


Reply
Thread Tools Rate Thread

Commas and Semi-colons in comboboxes

 
 
Dirkasaurus
Guest
Posts: n/a
 
      30th Sep 2003
Does anyone know some type of work around or a variable setting that allows
MSAccess combos to not treat commas or Semicolons as carriage returns?

If the combo gets its data from a MS Table it can handle Commas or semi
colons, but if it gets it from string values via code that MSAccess treats
them as carriage returns and breaks of the data accorddingly.

Any suggestions?
Thanks


 
Reply With Quote
 
 
 
 
Cheryl Fischer
Guest
Posts: n/a
 
      1st Oct 2003
If you must handle this in code for a combo or list box with its Row Source
Type set to "Value List", you will need to insert quotation marks around
each value explicitly:

Me.Combo1.RowSource = Chr(34) & "Doe, John" & Chr(34) & "," & Chr(34) &
"Brown, Mary" & Chr(34) & "," & Chr(34)

It is lots less work to do this using a table or query into the table (to
update the RowSource) as the Row Source for a combo or list box.

--
Cheryl Fischer
Law/Sys Associates
Houston, TX

"Dirkasaurus" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Does anyone know some type of work around or a variable setting that

allows
> MSAccess combos to not treat commas or Semicolons as carriage returns?
>
> If the combo gets its data from a MS Table it can handle Commas or semi
> colons, but if it gets it from string values via code that MSAccess treats
> them as carriage returns and breaks of the data accorddingly.
>
> Any suggestions?
> Thanks
>
>



 
Reply With Quote
 
Cheryl Fischer
Guest
Posts: n/a
 
      1st Oct 2003
A slight correction:

Me.Combo1.RowSource = Chr(34) & "Doe, John" & Chr(34) & "," & Chr(34) &
"Brown, Mary" & Chr(34) & "," & Chr(34) & "Smith, Jim" & Chr(34)


--
Cheryl Fischer
Law/Sys Associates
Houston, TX

"Dirkasaurus" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Does anyone know some type of work around or a variable setting that

allows
> MSAccess combos to not treat commas or Semicolons as carriage returns?
>
> If the combo gets its data from a MS Table it can handle Commas or semi
> colons, but if it gets it from string values via code that MSAccess treats
> them as carriage returns and breaks of the data accorddingly.
>
> Any suggestions?
> Thanks
>
>



 
Reply With Quote
 
Dirk Goldgar
Guest
Posts: n/a
 
      1st Oct 2003
"Dirkasaurus" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)
> Does anyone know some type of work around or a variable setting that
> allows MSAccess combos to not treat commas or Semicolons as carriage
> returns?
>
> If the combo gets its data from a MS Table it can handle Commas or
> semi colons, but if it gets it from string values via code that
> MSAccess treats them as carriage returns and breaks of the data
> accorddingly.


Are you talking about setting the combo box's RowSource to a value list?
You have to enclose any values that include commas or semicolons in
quotes. If you're setting the RowSource property on the property sheet,
you could do it as in this example:

Row Source ......... A; "B; C"; "D, E", F

If you're setting the property in code, you need to use quoted strings
*inside* the quoted string literal. Here's an example:

Me.List0.RowSource = "A; 'B; C'; 'D, E', F"

You can also get internal quotes by doubling up the double-quotes:

Me.List0.RowSource = "A; ""B; C""; ""D, E"", F"

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)


 
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
colons =?Utf-8?B?Z3V5?= Microsoft VB .NET 2 20th Nov 2007 12:31 PM
How do I address my emails with semi colons instead of commas? =?Utf-8?B?U3RhY2V5QGN0Y3Nz?= Microsoft Outlook 3 26th Sep 2007 05:38 PM
Semi Colons appearing at the end of contact information =?Utf-8?B?Q2hlcw==?= Microsoft Outlook Contacts 0 23rd Aug 2006 03:53 PM
inserting semi-colons for a mass emailing =?Utf-8?B?bWVnYW5zaW1vbi1zcG9ydHNjb21taXNzaW9u?= Microsoft Word Document Management 2 24th Mar 2006 05:21 PM
how do I change autoformatted em dashes to semi-colons in Word 97? =?Utf-8?B?U2hlbGNyYWZ0?= Microsoft Word Document Management 1 2nd Oct 2005 01:06 PM


Features
 

Advertising
 

Newsgroups
 


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