Skip to main content
1-Visitor
November 10, 2017
Solved

ComboBox Control

  • November 10, 2017
  • 2 replies
  • 5215 views

Hi everybody

does any body have idea how can I set VBscript behind a contorl to use it as a dynamic combo box

I mean I want to set 2 combo box in worksheet which senond one being depends on selection in the first one

as we can do it in listbox but I was not succeed to do the same in combo box

I am not that much familiar with VBscript and I do not know which part of code is wrong 

and I also know it needs something like Listbox.resetCount at the first but for comboBox so your help will be highly apriciated 

I attached my trying file

thanks

Best answer by MJG

See attached.  You needed to put list values in quotes and account for ListIndex<0 (when you change Material, the previous value for Section becomes invalid, so ListIndex goes to -1).

2 replies

1-Visitor
November 10, 2017
Ramakr561-VisitorAuthor
1-Visitor
November 10, 2017

Thanks MJG

Actulay I have already cheched all this topics & worksheet

there is no answer to me on there

 

MJG1-VisitorAnswer
1-Visitor
November 10, 2017

See attached.  You needed to put list values in quotes and account for ListIndex<0 (when you change Material, the previous value for Section becomes invalid, so ListIndex goes to -1).

19-Tanzanite
November 10, 2017

See the attached worksheet. Look for the dynamically controlled listboxes.

Ramakr561-VisitorAuthor
1-Visitor
November 10, 2017

Thanks Richard

I have seen this file and leanned alot of that , but unfortunately there is not any dynamicly ComboBox inside the file 

I saw dynamiclt list box but script codes are diffrenet 

anyhow MJG fixed main part of my problem with his reply I just know need to know how to makes automatic list updated after choosing material in the first combo box 

in listbox control the code is ListBox.ResetCount but I do not know what is equivalent in ComboBox

thanks again

1-Visitor
November 10, 2017

rreyhanian,

The method for creating the list options in a ListBox was to add list values.  Therefore, it was necessary to clear the current list before adding the new list options.  The method that you are using to create the list options in the combobox automatically overwrites the existing list, so there is no need.

 

Edit: I assumed you were referring to ListBox.ResetContent().  If you truly meant Listbox.resetCount, I'm not sure what you mean - please clarify.