General information
Category:
Forms & Form designer
Also check out the MSDN Help files under Option Group Control and Option Button Control.
Your welcome.
R D Black
>Thank you. I will give it another try ;)
>
>
>>Yes, if you are testing the value of the option button that is or is not selected then you have to test for the this.option1.value as 0 or 1. If you want to use the value tested to change your field value to a YES or NO you could do it like this,
>>
>>If this.option1.value=1 &&If option1 is selected
>>replace actcompl.nontrad with "YES"
>>else
>>replace actcompl.nontrad with "NO"
>>endif
>>
>>
>>This will give you the Yes/No in the field that you are looking for.
>>
>>Hope this helps.
>>
>>
>>
>>
>>>Hi Roelaux,
>>>
>>>Thank you for the reply.
>>>
>>>I was trying to use the approach of setting the value for the option group to a character rather than numeric, and using the captions on the buttons. Do I still have to treat the value as a number
>>>
>>>TIA, Al
>>>
>>>>Hi Al,
>>>>
>>>>In an optiongroup the value of the selected option button is 1. The value of the option button not being selected is 0.
>>>>
>>>>I your example I'm guessing that THIS.Value is testing the value of the one of the option buttons? If so in the optiongroup interactivechange,
>>>>
>>>>
>>>>If this.option1.value=1 &&If option1 is selected
>>>>replace actcompl.nontrad with .T.
>>>>else
>>>>replace actcompl.nontrad with .F.
>>>>endif
>>>>
>>>>Hope this helps.
>>>>
>>>>
>>>>>I am trying to use an option group with two buttons, Yes and No, to represent the state of a logical field.
>>>>>
>>>>>the interactivechange,
>>>>>
>>>>>IF THIS.Value = 'Yes'
>>>>> REPLACE ACTCOMPL.nontrad WITH .T.
>>>>>ELSE
>>>>> REPLACE ACTCOMPL.nontrad WITH .F.
>>>>>ENDIF
>>>>>
>>>>>seems to work and display correctly,
>>>>>but in the init I have:
>>>>>
>>>>>IF ACTCOMPL.nontrad
>>>>> THIS.Value = 'Yes'
>>>>>ELSE
>>>>> THIS.Value = 'No'
>>>>>ENDIF
>>>>>
>>>>>to display the current value when the form opens, but it always displays 'No' regardless of the field value
>>>>>
>>>>>Any suggestions?
>>>>>TIA
>>>>>
>>>>>Al
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