Even simpler/faster as:
llcompleted = (thisform.chkcompleted.value == 1)
The original problem is a misconception in how IIF functions. It will return the VALUE of one of two expression - it will NOT execute the code.
Don
>>Here is the situation. I want to assign a value to a variable depending of whether or not a certain check box is checked. Normally, I would have used this statement:
>>
>>IIF (thisform.chkcompleted.value = 1,llcompleted = .T.,llcompleted = .F.)
>>
>>However, for some unknown reason, it seems that the statement always return false, even when the checkbox is checked. So I had to use this instead
>>
>>IF Thisform.chkcompleted.value = 1
>> llCompleted = .T.
>>ELSE
>> llCompleted = .F.
>>ENDIF
>>
>>By using this, it works fine, but I just wonder if there is anything I didn't do correctly??
>>Just a small question also, something in this place we see pale blue rectangles with code in it. How do you do that?
>>
>>David
>>
>>It is said that we learn by our mistake. Boy, I never thoug I could learn that much!!!
>
>Have you tried
>
>llcompleted = IIF (thisform.chkcompleted.value = 1,.T.,.F.)
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement