I'm sure this has been asked many a time, and I'm sure for what is probably a repeat post, but after much attempt I'm still failing at simply looping through all the controls on my form and outputting the name and caption of that object if it is an optionButton, Frame, CheckBox, or Label.

I currently have the code just for frame looking like this...

vb Code:
  1. Dim ctl As Control
  2. For Each ctl In Me.Controls
  3.     If TypeOf ctl Is OptionButton Then
  4.         MsgBox (ctl.Caption)
  5.     End If
  6. Next ctl

This loop appears to iterate but never see a msgbox... The above code works for a frame, but not for option buttons.... Any help would be appreciated! thanks!