I thought about this some more and I realized that you have presented a question in isolation without explaining what you are doing. So I answered your question exactly as asked without actually solving your problem
The answer I gave you is good if you want to store that value every time you click a button. But that is not usually how people design these things. I suspect that what you may really want is to have a Submit or Close button, and store the value when the user hits that button. In that case your code concept is OK and would look like this:
You must do the loop on a generic Control object because there is no collection for each specific type of control. Then when you find an OptionButton, you set it to a specific OptionButton object so you can access the GroupName property (not available in a Control object).
Throw out all that other stuff I did, except for SaveCaption.
Bookmarks