
Originally Posted by
Steiner
I'm not quite sure what you want to do, but maybe this loop might get you started:
Dim Ctl As Control
For Each Ctl In Me.Controls
If TypeOf Ctl Is OptionButton Then
Debug.Print Ctl.Name & ": " & Ctl.Value
End If
Next Ctl
It goes through all controls on the current form, checks if the control is an optionbutton and if it is, it prints the name and value to the debug view.
Daniel
Manu,
Steiner's code will work according to your needs if you add all selected options to an array or string.
Sample below is untested. Might have some error.
Dim Ctl As Control
For Each Ctl In Me.Controls
If TypeOf Ctl Is OptionButton Then
MsgBox Ctl.Name & ": " & Ctl.Value
DoFunction(Ctl.Name) 'pass val to a function to verify right / wrong
End If
Next Ctl