My approach would be:
First field , LostFocusEvent :
* just trigger Refresh event of second field
this.Parent.second_field.refresh()
Second field, Refresh Event
If this.Parent.First_field.value = "Y"
This.enabled = .t.
else
This.enabled=.f.
endif
Srecko
>Thank's to all for the tips you gave me yesterday.
>
>Let me first remind you of what I was trying to solve the problem for.
>I have a form in witch I have a field that can have a value of "Y" or "N" only. In the next field's WhenEvent , I want to test for the content of the first field . If the first field contains "Y" then I enable this field otherwise I dont.
>
>But now I have a new problem. I the user changes is mind an decides to go back to field on and change its content to the other possible value then it does not work.
>
>Here is what I tried , but this time I get an unknown member error.
>The error happens in the LostFocusEvent.
>
>First field , LostFocusEvent :
>
>if this.value = "Y"
> This.parent.second_Field.enabled = .t.
>else
> This.parent.second_Field.enabled = .f.
>endif
>
>Second Field , WhenEvent :
>
>If this.Parent.First_field.value = "Y"
> This.value = table.second_field
>else
> This.value = ""
>endif
Précédent
Suivant
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