Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
GETFLDSTATE not working consistently?
Message
De
24/07/2014 08:26:39
 
 
À
24/07/2014 07:09:45
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 8
Network:
Windows 2008 Server
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01604554
Message ID:
01604560
Vues:
90
This message has been marked as the solution to the initial question of the thread.
>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform