D
Derek P.
Is it possibly to create dynamic user forms(UF) that still have the ability
to have event driven logic?
Here is a simple example.
Non dynamic uf structure.
You have a UF (Non_Dynamic_UF) that you create with two combo boxes, CBX1
and CBX2. The contents of CBX2 are dependent on CBX1, such that.
CBX1 = Fruit, CBX2 has list Apple, Bannana, Orange
CBX1 = Vegitable, CBX2 has Corn, Potato, Broccoli
In the Non_Dynamic_UF section, I would create a function so that whenever
CBX1 changes value, CBX2 has its list re-defined.
Private Sub CBX1_Change()
'Code to manipulate CBX2 item list implemented here.
End Sub
NOW I want to re-create this same functionality in a dynamic UF where i add
these two combo boxes with code. Using the (UserForm).controls
collection/object, I know how to add both of the combo box controls.
THE QUESTION IS, can I also dynamically add in the EVENT DRIVEN logic that
updates CBX2's list items whenever CBX1 changes that is demonstrated in the
non dynamic uf example above?
IF IT CAN BE DONE,.... how does one go about doing it?
If it can't be done,....dang it!
Thanks everyone.
to have event driven logic?
Here is a simple example.
Non dynamic uf structure.
You have a UF (Non_Dynamic_UF) that you create with two combo boxes, CBX1
and CBX2. The contents of CBX2 are dependent on CBX1, such that.
CBX1 = Fruit, CBX2 has list Apple, Bannana, Orange
CBX1 = Vegitable, CBX2 has Corn, Potato, Broccoli
In the Non_Dynamic_UF section, I would create a function so that whenever
CBX1 changes value, CBX2 has its list re-defined.
Private Sub CBX1_Change()
'Code to manipulate CBX2 item list implemented here.
End Sub
NOW I want to re-create this same functionality in a dynamic UF where i add
these two combo boxes with code. Using the (UserForm).controls
collection/object, I know how to add both of the combo box controls.
THE QUESTION IS, can I also dynamically add in the EVENT DRIVEN logic that
updates CBX2's list items whenever CBX1 changes that is demonstrated in the
non dynamic uf example above?
IF IT CAN BE DONE,.... how does one go about doing it?
If it can't be done,....dang it!
Thanks everyone.