>Hello,
>
>I have a form where somem values are to be computed on save. But the computytion should only happen when certain fields are changed. I try to do this with some GETFLDSTATE() calls that set a trigger. Prior tosaving I call a function to compute the values if the trigger is .T.. This workes. But if I change one of the fields and click on the save button without first leaving the field the tigger is not set.
>
>If this know behaviour?
>How do I circumvent it?
>Else, what do I miss?
Yes, this is known behavior if the Save button is on a toolbar, not the form itself. It's because buttons on a toolbar don't ever get focus, so the textbox's LostFocus event doesn't fire and things that happen when the textbox loses focus (such as the new value being stored to the ControlSource) don't happen.
You need to force focus to move. Try putting this code at the top of your Click code in toolbar buttons:
IF TYPE(“_screen.ActiveForm.ActiveControl.Name”) = “C”
IF PEMSTATUS(_screen.ActiveForm.ActiveControl,”SetFocus”,5)
_screen.ActiveForm.ActiveControl.SetFocus()
ENDIF
ENDIF
Tamar