>The code would be more readable if I was able to use the button descriptions in a case statement instead of numbers, especially if there are more than two options. How would you do that?
PMFJI, You could use constants to hide the numbers.
#DEFINE THIS_ONE 1
#DEFINE THAT_ONE 2
#DEFINE ALPHA "A"
#DEFINE BETA "B"
This.Value = IIF( Alias.Field = ALPHA, THIS_ONE, THAT_ONE)
or
do case
case Alias.Field = ALPHA
This.Value = THIS_ONE
case Alias.Field = BETA
This.Value = THAT_ONE
endcase
hth
>Alex
>
>>Alex,
>>
>>Assume the two codes are A and B and the text is "This One" and "That One".
>>
>>Set up your option group with two buttone, set the button captions to This One and That One. Do not set the controlsource at all. In teh OptionGroup's Refresh method put this;
>>
>>
>>This.Value = IIF( Alias.Field = "A", 1, 2)
>>
>>
>>In the InteractiveChange of the OptionGroup put this;
>>
>>
>>REPLACE Alias.Field WITH IIF(This.Value=1,"A","B") IN Alias
>>
Roi
'MCP' Visual FoxPro
In Rome, there was a poem.
About a dog, who found two bone.
He lick the one, he lick the other.
He went pyscho, he drop dead!