>>
>>That's a good example why it's not healthy practice to use Control.Valid events. IMHO, the right solution is to move all validations to cmdSave.Click event.
>
>Thank you for replying.
>
>I have an initial form. There is only one sigificant object which is the combo box. According the value picked from the combo box the corresponding class will be loaded for the screen data entry. If the value picked is invalid, an error message will show on the form.
>
>On Valid method, I put the following code
>
>local oObject
>oObject = sys(1270) && object reference to the control the
> && user just clicked on
>
>if lastkey() = 27 .or. (type("oObject") = "O" .and. ;
> type("oObject.lCancel") = "L" .and. ;
> oObject.lCancel)
> return .t.
>endif
>
>return this.Validation()
>
>If I know what the inkey value for Close Button X, I could avoid to trigger the Validation() method. Any suggestions?
>
>Jim S
Move code from Valid to InteractiveChange event.
Edward Pikman
Independent Consultant