Why is comma being treated as a semi-colon in a Combo Box Value Li

J

JDJones

I am creating a value list from an sql query. The list has embedded commas
in some of the text. The combo box seems to be treating the commas as if
they were semi-colons. What gives? Is there an escape sequence I can use to
make the value list not treat the commas in a special way?
 
D

Duane Hookom

Is there a good reason for using a value list type? Can't you use a
table/query type? Can you share the code you are using?
 
J

JDJones

I was having problems doing it the query way. It was a lookup of a lookup of
a lookup. I've since solved the problem with a Requery command. It really
does work better this way. Thank you.
 
D

datAdrenaline

I know the the solution the Duane gave you worked ... and truly is better
that creating a value list ... but ... just in case you ever need to create a
value list from a function that returns a string, you should make the
function create a string that encapsulate the values in single (or dbl)
quotes...

So instead of this:
strMyValues = "Value1;Value2,Descriptor;Value3"
ctl.RowSource = strMyValues

You should use this:
strMyValues = "'Value1';'Value2,Descriptor';'Value3'"
ctl.RowSource = strMyValues

But ... again .. I fully support the response provided by Duane as a primary
mechanism for the rowsource of a list box/combo box...
 

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