I have a loop that each time generate a optionbutton dynamic:
Dim opt_btn as OptionButton
Set opt_btn = Me.Controls.Add("Forms.OptionButton.1", "optid" & i)
(where i changes each time in the loop, 1,2,3..)
How do I do to add a clickevent on these optionbuttons ?
If the OptionButton was "ordinary" i would write:
Private Sub optid1_Click()
msgbox "This is optid1"
End Sub
But how do I do when they are created dynamic ?? Anyone who knows ? Thanks.
Dim opt_btn as OptionButton
Set opt_btn = Me.Controls.Add("Forms.OptionButton.1", "optid" & i)
(where i changes each time in the loop, 1,2,3..)
How do I do to add a clickevent on these optionbuttons ?
If the OptionButton was "ordinary" i would write:
Private Sub optid1_Click()
msgbox "This is optid1"
End Sub
But how do I do when they are created dynamic ?? Anyone who knows ? Thanks.