Get the option group of a particular control

rockman

Senior Member
Local time
Today, 10:11
Joined
May 29, 2002
Messages
190
How can I get the name of the option group that a particular control belongs to?

Example:

Option Group Name = grpChoices
A control's name within the option group = chkDaily

Is there some syntax to obtain the name of the option group given the control's name?

Like : Forms!myForm!chkDaily.GroupName


Thanks for any suggestions,
Jeff
 
I believe the .Parent of the Option Button is an Option Group object (control).
 
Thanks for the tip. I had used Forms!myForm!chkDaily.Parent and it returned "-1". But your post prompted me to try Forms!myForm!chkDaily.Parent.Name which does indeed return "grpChoices".

Thanks again,
Jeff
 
Yup. I'll conjecture that the -1 you got was the current or default VALUE of the Option Group when you queried it. Using .Name would give you the name you wanted. Which of course would then be usable in the syntax

{form-name}.Controls(object-name)

to select the given option group to get its other properties.
 

Users who are viewing this thread

Back
Top Bottom