Print Page | Close Window

Adding Items to ComboBox with an "&"

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=1552
Printed Date: 22 June 2025 at 12:46pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Adding Items to ComboBox with an "&"
Posted By: DDJJ
Subject: Adding Items to ComboBox with an "&"
Date Posted: 17 December 2004 at 1:51pm

Couldn't find this in a search of the forum.

How do you add items to a CommandBar ComboBox that contain an "&" in the expression (like Johnson & Johnson)?  I've tried a few variations of the following, without success:

sListItem = Replace(sListItem, "&", "' & '")

Thanks!




Replies:
Posted By: SuperMario
Date Posted: 17 December 2004 at 1:57pm
I have no problem adding them.  You can hard code it and say "Johnson & Johnson" or place that string in a variable then assign it.


Posted By: DDJJ
Date Posted: 17 December 2004 at 2:10pm

What's happening to me is the ComboBox is showing "Johnson _Johnson". 

I am retrieving the string from a database field, assigning it to a string variable, then adding it to the combo using the AddItem method.  Any kind of an "&" gets converted to an underscore.  Same thing when I (for testing purposes) hard code the string variable.



Posted By: SuperMario
Date Posted: 17 December 2004 at 2:19pm
OK, I see, it is displayed OK when dropped down, but when selected it displays the underscore.  If you use "&&" if fixes the one problem but displays "&&" in the drop down.  I think I remember this being a bug in the report control and it was fixed, so submit this as a bug so the development team can fix it


Posted By: Oleg
Date Posted: 20 December 2004 at 4:39am

We fixed it. Thank you.



-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net