Hopefully this is something quick.

I have a form with 4 group boxes. 2 of them have text boxes. I found how to clear them quick enough in past postings to this forum.

The basic idea is that you have to loop through the controls to find the group box then loop to find the text boxes, like this:

VB Code:
  1. For Each c1 As Control In Me.Controls
  2.             If TypeOf c1 Is GroupBox Then
  3.                 For Each c2 As Control In c1.Controls
  4.                     If TypeOf c2 Is TextBox Then
  5.                         c2.Text = Nothing
  6.                     End If
  7.                 Next
  8.             End If
  9.         Next

So I tried to add another IF statement to uncheck the radio boxes. Something like:

VB Code:
  1. If TypeOf c2 is RadioButton Then
  2.     c2.Checked = False
  3. End If

but that doesn't work. Checked is not a parameter that you can change for a control.

I only had 8 radio buttons, so I just did :

VB Code:
  1. RadioButton1.Checked = False
  2.         RadioButton2.Checked = False
  3.         RadioButton3.Checked = False
  4.         RadioButton4.Checked = False
  5.         RadioButton5.Checked = False
  6.         RadioButton6.Checked = False
  7.         RadioButton7.Checked = False
  8.         RadioButton8.Checked = False

But is there a better way?