This looks correct. As a quick test, try putting this right before the Select
Case:
MsgBox optngrpScripts
Does it come back with a valid value (i.e. the one associated with the
option)? If not, then the option group may not be constructed properly.
Also, depending on how you set up your option group, the value of the first
one is probably 1, not 0, and the second one is 2, not 1, etc. That was my
error in round 1.
You might try re-creating the option group using the wizard to make sure it
is all constructed correctly (i.e. the values assigned to each option). It
asks for the label names and the value to be associated with each one.
Rod said:
Brian,
It looks like this:
Private Sub optngrpScripts_Click()
Select Case optngrpScripts
Case Is = 0
tbxScripts = "My Text # 1"
Case Is = 1
tbxScripts = "My Text # 2"
End Select
End Sub
optngrpScripts is the Option Group which has the four option buttons. The
dugger comes up when I run the form and selecting any of the buttons cause no
changes in Text Box named tbxScripts. Any suggestions?
:
I think this is the correct way of returning OptionGroup values, but I didn't
test this first. Put it on a button_click event perhaps.
Select Case OptionGroup1
Case Is = 0
Text1 = "My Text # 1"
Case Is = 1
Text1 = "My Text # 2"
'etc.
End Select
The source of the text can also be a DLookup from a memo field in a table,
something like this: Dlookup"[fldNotes]","[tblNotes]","[fldID] = " &
OptionGroup1 + 1
For the first option, OptionGroup1 has a value of 0, so the DLookup would
pick fldID #1, the second has a value of 1, so DLookup would find #2, etc.
:
Hello,
I have scripts I need to display in a text box on a form. The script to be
displayed is dependent on what option is chosen in an option group. A given
script is about 500+ words. Do you know how I can do this?