Dependent combo boxes in user dialog box via macro

  • 1
  • Question
  • Updated 2 years ago

I have a niche use case where I need to use dependent combo boxes in the user dialog box. 

By dependant I mean, I need 2 combo boxes in the user dialog box where each selection in the first combo box has a different set of options in the second combo box. And the selected option in the second combo box is the input text to the newly added topic. 

To my understanding, the only possibility seems to be is having two user dialog boxes where one dialog can trigger other with both having respective combo boxes. Where input options of the combo box in the second user dialog box change based on the output and selection of combo box in the first user dialog box. I hope I explained my problem correctly. 

I have a decent familiarity with VBScript and I have coded a functional macro where input from one combo box is added text to the newly added topic. I only need help with having dependent combo boxes.

Any inputs regarding this problem would be helpful.

Photo of gthghcdng


  • 5 Posts
  • 0 Reply Likes

Posted 2 years ago

  • 1
Photo of Nick Duffill

Nick Duffill, Champion

  • 606 Posts
  • 249 Reply Likes
The answer is to use a Dialog Function with the user dialogue. This function is called every time a button is pressed, control focus changes, a control value changes and so on. It even has an idling call that you can use to perform housekeeping on a dialogue. When a change in the first combo box is detected, you can dynamically reload the choices in the second one. There is a prototype for the Dialog Function in the WWB.Com Help from within the macro editor window.