Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Optiongroup problem
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00399631
Message ID:
00399661
Vues:
10
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform