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

combobox multiple entry

P: 9
Hi...

how to avoid multiple entry display in combo box?

ie) if we are displaying the TV List in Combo...

combo1.additem "samsung"
combo1.additem "onida"
combo1.additem "samsung"

how to disaply onida and samsung one time...?

Sree..
May 2 '08 #1
Share this Question
Share on Google+
3 Replies


debasisdas
Expert 5K+
P: 8,127
You need to check if the item already exists before adding that to the list.
May 2 '08 #2

lotus18
100+
P: 866
Hi...

how to avoid multiple entry display in combo box?

ie) if we are displaying the TV List in Combo...

combo1.additem "samsung"
combo1.additem "onida"
combo1.additem "samsung"

how to disaply onida and samsung one time...?

Sree..
Doing loops will fix this.

Rey Sean
May 2 '08 #3

P: 20
Expand|Select|Wrap|Line Numbers
  1. dim Exists as boolean=false
  2. for i as integer=0 to your_combo.items.count-1 do
  3. if your_combo.items.item(i)=new_equipment_name then
  4. Exists=true;
  5. exit for;
  6. end if
  7. next
  8.  
  9. if not Exists then
  10. your_combo.items.add(new_equipment_name)
  11. else
  12. msgbox("Already in the list")
  13. end if
  14.  
May 5 '08 #4

Post your reply

Sign in to post your reply or Sign up for a free account.