By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,282 Members | 1,690 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,282 IT Pros & Developers. It's quick & easy.

How can I add items to combo box without using ";" in additem method

P: n/a
Hello

I have one problem in vba. I have combo box, which has for example 3 columns.
Then I want to add items to suitable columns without using ";"
separator.

cmb_name.additem "string1" + ";" + "string2" + ";" + "string3"

becaase string1, string2, string3 can contain ";" mark as well

please give me any solution, which solves this problem.
thanks
Nov 13 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Private Sub Form_Load()
cbxMyList.RowSourceType = "Value List"
cbxMyList.RowSource = Chr(34) & "3;C" & Chr(34) & ";" & Chr(34) & "4;F"
& Chr(34)
End Sub

created the following dropdown:
3;C
4;F

Does this solve your problem?

James A. Fortune

Nov 13 '05 #2

P: n/a
In news:51**************************@posting.google.c om,
Jareckipw typed:
Hello

I have one problem in vba. I have combo box, which has for
example 3 columns. Then I want to add items to suitable
columns without using ";"
separator.

cmb_name.additem "string1" + ";" + "string2" + ";" +
"string3"

becaase string1, string2, string3 can contain ";" mark as
well

please give me any solution, which solves this problem.
thanks

My first thought is to use a table which you clear then fill
with the rows you want in code. Then just use a Select in
the source for the combo. BUT, I can't remember if having a
; anywhere in the returned string will work. It still might
be worth trying...

--
Nick Coe (UK)
Available - Will work for money :-)
http://www.alphacos.co.uk/ AccHelp + pAnimal
http://www.pjandcoe.co.uk/ TShirts with Bark Factor!
Nov 13 '05 #3

P: n/a
ji********@compumarc.com wrote in message news:<11*********************@o13g2000cwo.googlegr oups.com>...
Private Sub Form_Load()
cbxMyList.RowSourceType = "Value List"
cbxMyList.RowSource = Chr(34) & "3;C" & Chr(34) & ";" & Chr(34) & "4;F"
& Chr(34)
End Sub

created the following dropdown:
3;C
4;F

Does this solve your problem?

James A. Fortune


Thanks for your reply. This code solves my problem. I'm grateful.
I try work out this issue but I use only additem.
You notice that this work only with rowsourcery , doesn't work with
additem.:) It is very strange.
But I'm glad that that code works.

Thx
Jarosław Kurek
Warsaw University of Technology.
Warsaw
Nov 13 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.