Hello all,
I posted my ActiveX ComboBox question a few days ago (I've included my original message below). Basically, I have a combo box with items:
Space(Null String)
Item 1
Item 2
Item 3
Item 4
I need:
Space(NS)
Item 1 Renamed
Item 2 Renamed
Item 3 Renamed
(Item 4 removed)
I was able to use the following VBA code, which renamed (but also duplicated) the items and also stalled my computer a few times:
1 Sub ComboBox3_Change()
2 ComboBox3.AddItem "", 0
3 ComboBox3.AddItem "Item 1 Renamed", 1
4 ComboBox3.AddItem "Item 2 Renamed", 2
5 ComboBox3.AddItem "Item 3 Renamed", 3
6 ComboBox3.RemoveItem 4
7 ComboBox3.Style = fmStyleDropDownList
8 ComboBox3.BoundColumn = 0
9 ComboBox3.ListIndex = 0
10 End Sub
Another variation I tried was to remove all items individually i.e line 6 repeated for all the items (0-4) first, then lines 1-5,7-10 following that. I also had ComboBox3.Clear precede the above chunk of code (line 6 excluded).
The solution doesn't seem too far away...
Any ideas would be appreciated!
Thanks!
Alex
>Original message:
>Hello all,
>
>I have an ActiveX combo box which has four drop-down items; one of the >items was misspecified and I simply need to change the text - the combo >box functions perfectly otherwise.
>
>Now, I was able to modify the text in design view - the problem is, once I >left the design view, my drop-down items remained unchanged.
>
>If anyone has any pointers on this, that would be great!
>
>Thanks in advance,
>
>Alex
Bookmarks