cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

ComboBox Control

SOLVED
Highlighted
Regular Member

ComboBox Control

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

1 ACCEPTED SOLUTION

Accepted Solutions

Re: ComboBox Control

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).

View solution in original post

9 REPLIES 9

Re: ComboBox Control

Re: ComboBox Control

Thanks MJG

Actulay I have already cheched all this topics & worksheet

there is no answer to me on there

 

Re: ComboBox Control

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).

View solution in original post

Re: ComboBox Control

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

Re: ComboBox Control

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

Re: ComboBox Control

Perfect MJG

I was bussy with that for 2 days and finaly u solved it for me and I am so Happy now 🙂

as it ssems you are perfect in thet would you please tell me how can I make auto update combobox list

I know in Listbox Control it is ListBox.Reset.Count but what is equivalent in Combo Box ??

or can you intruduce me a source of thiese code to study?

I realy like to learn them..

thanks again

Re: ComboBox Control

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.

Re: ComboBox Control

Yes exactly I mean ListBox.Reset.Count but based on your reply I do not need that because in combo box it is automaticly updated but as you see the list of avlue in second combo box is not updated until I click on it

 

but in dynamicly list box is not like that and after selecting in the first list box , second list box will automaticly is updating before you click on it

 

this is the think I am looking for ...

 

Edited : I attached a listbox  example which is updating quickly after first choosing

 

 

Re: ComboBox Control

I found it

that is in attaced  file 🙂