Multivalue combo box question

T

Tamiam

I have a question perhaps someone can help me with. I am using the lookup
combo box with multi value option in my forms to display one or multiple
colors available in horses. It is working great except one thing I am
wondering. Is it possible to change or even not use the comma's that come up
as dividers between each value entered. I need it to say red dun instead of
red, dun when displayed in my form. Any suggestions?
 
A

Allen Browne

Presumably we are talking about Access 2007 here, as previous versions did
not have multi-valued fields or combos that supported multiple values.

You cannot remove the delimiter from the combo itself.

You could display the result in a text box without the comma if you looped
through the array of values selected in the control and generated a string.

Alternatively, you could just DLookup() the values in the field (assuming
the bound field is the visible one), and use Replace() to remove the comma.
The expression for the text box would be something like this:
=Replace(DLookup("Field1", "Table1", "SomeField = """ & [MyKeyID] &
"""), ",", "")
For help with forming the 3rd argument for DLookup(), see:
http://allenbrowne.com/casu-07.html
 
Top