I have a user form with 50 rows each containing the controls in order as: Togglebutton101, Togglebutton1, Textbox301, Checkbox1, Textbox1, Combobox1, Combobox101, Checkbox101 and a Commandbutton1.
What I want to do is when I click the commandbutton1 then its preceding controls in its row returned to their default value. I have a code for this but how can I write this for 50 command buttons using class module?
What I want to do is when I click the commandbutton1 then its preceding controls in its row returned to their default value. I have a code for this but how can I write this for 50 command buttons using class module?
HTML:
Private Sub Cbutton_Click()
dim h as long
for h = 1 to 50
AB_Paper.Controls("ToggleButton" & h + 100).Value = False
AB_Paper.Controls("ToggleButton" & h).Value = False
AB_Paper.Controls("TextBox" & h + 300).Value = 4
AB_Paper.Controls("CheckBox" & h).Value = False
AB_Paper.Controls("TextBox" & h).text = ""
AB_Paper.Controls("ComboBox" & h).Text = "Block"
AB_Paper.Controls("ComboBox" & h + 100).Text = ""
AB_Paper.Controls("CheckBox" & h + 100).Value = False
Next
End Sub