In
Les said:
I must not have the group built correctly I do not find a OptionValue
property anywhere. I dragged the group box to the form and them from
the field list I dragged each field I wanted to use in the option
group to the form. the option buttons work when you press one the
other goes off which is what I want because they can only select one.
but I can not find the optionvalue property.
The group itself does not have an OptionValue property, just the Value
property, which is its default property. Each individual control within
the option group has an OptionValue property, which is the value that
the option group will have when that control is selected. You'll find
the OptionValue property (with its name displayed as "Option Value") on
the Data tab of each option button's property sheet. The Value property
of the option frame reflects the OptionValue property of whichever
option button is currently selected.
Suppose you have an option group frame named "Frame0", and the group
contains three option buttons named, say "Option3", "Option5", and
"Option7". Each of these option buttons will have a distinct numeric
OptionValue property; for example, they may be
Option3 - OptionValue = 1
Option5 - OptionValue = 2
Option7 - OptionValue = 3
If that is the case, then you can check which option button is currently
selected by testing the value of Frame0, like this:
Select Case Frame0
Case 1
' Option button Option3 is selected
Case 2
' Option button Option5 is selected
Case 3
' Option button Option7 is selected
Case Else
' Some other option is selected (if any), or else
' no option has been selected yet, in which case
Frame0 is Null.
End Select