Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Calculations in a control box
Message
De
26/08/1998 00:48:48
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00129868
Message ID:
00129937
Vues:
18
Hi Diana ---

A good point. If in a situation where you are explicitly locking tables or other "hard" save routine at the end of an edit (ala FP2.6 and earlier), you are 100% correct. In the VFP environment, with optimistic buffering, it's half-dozen of one and 6 of the other....you can always revert the edit as it's not "real" until TABLEUPDATE....


>
>I should have thought it better programming practice to change the value of the balance textbox and let the save process change the table's field value when the user chooses to execute it. Anyone else have comments on this?
>
>Diana
>
>>Hi Eric ---
>>
>>Place the calculation in a custom method in the form, such as CalcBalance. In the LostFocus of each control that could affect the balance do a THISFORM.CalcBalance. In the CalcBalance method, calculate the balance and use REPLACE to store it in the balance field in the table. The balance textbox should have a ControlSource of the balance field. After you have done the REPLACE in the CalcBalance method, refresh the balance textbox (THISFORM.txtBalance.Refresh). Also ensure that the balance textbox is disabled.
>>
>>
>>
>>
>>>
>>>What I need to do is create a "balance" text box on one of my forms, which involves a simple calculation using several fields. My question is how do I do the calculation, and then put the result into a field called "balance" in my table?
>>>
>>>If I set the control source to the calculation, the balance comes up correct, but the result is not entered into the table.
>>>
>>>Does anybody have the code to do this?
>>>
>>>Thanks a lot,
>>>Eric
------------------------------------------------
John Koziol, ex-MVP, ex-MS, ex-FoxTeam. Just call me "X"
"When the going gets weird, the weird turn pro" - Hunter Thompson (Gonzo) RIP 2/19/05
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform