Option control group unbound

G

Guest

I have a group control that has 8 option buttons and is not bound to the
table. if one of the option buttons is selected how do I know which one? do I
check the group of each option button. I have not found in the group where
the result would be nor have I found where the result would be in the
individual option.
 
D

Dirk Goldgar

In
Les said:
I have a group control that has 8 option buttons and is not bound to
the table. if one of the option buttons is selected how do I know
which one? do I check the group of each option button. I have not
found in the group where the result would be nor have I found where
the result would be in the individual option.

The value of the option group frame is the OptionValue property of the
currently selected option button. So you reference the option frame
itself, not the individual buttons.
 
G

Guest

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.
 
D

Dirk Goldgar

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
 
G

George Nicholson

The individual buttons have an OptionValue property, which must be a number.
The Value of the Option Group frame (aka "group box") returns the
OptionValue of the currently selected Option button.

You have 3 buttons. They have OptionValues of 1, 2 & 3 respectively. The
Value (not OptionValue) of the Option Group frame will be either 1, 2 or 3,
depending upon which button is currently selected.

The OptionGroup frame also has a DefaultValue property. If you set the
DefaultValue to 2, whichever button has the OptionValue of 2 will be the
"default" selection for new records.

HTH,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top