Try it this way.
Code:Private Sub OptionButton4_Click() For i = 2 To 6 With Me("Combobox" & i) .Value = vbNullString .Enabled = IIf(i <= 4, True, False) End With If i = 2 Or i = 3 Then With Me("Textbox" & i) .Text = vbNullString .Enabled = IIf(i = 2, True, False) End With End If Next End Sub Private Sub OptionButton5_Click() For i = 2 To 6 With Me("Combobox" & i) .Value = vbNullString .Enabled = IIf(i <= 4, False, True) End With If i = 2 Or i = 3 Then With Me("Textbox" & i) .Text = vbNullString .Enabled = IIf(i <> 3, False, True) End With End If Next End Sub




Reply With Quote
Bookmarks