General information
Category:
Coding, syntax & commands
Couple of observations here....
First, by default, an optiongroup holds a numeric type which corresponds to the ordinal positon of the contained option buttons. So, if the 5th button in the group is selected, the value of the optiongroup will be 5.
Second, the way you are constructing your syntax is a nightmare in waiting. Based on the code, the assumption is that the option group will ALWAYS be in page1 of pageframe1 and that the pageframe will always be directly contained on the form.
You are using what I like to call the outside-in approach. I like the inside-out approach, one where you traverse the containership hierachy. So, if a control that shares the same parent container needs to query the value, this code will work:
If This.Parent.OptionGroup1.Value = 5
Endif
In cases where other controls in other containers need access to the optiongroup, you can have a form-level property points to the option group. Then, any controls that need to reference the optiongroup could do so as follows:
If thisform.oOptionGroup.Value = 5
EndIf
The deal is that there should be MINIMAL code changes when moving controls around....
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only