Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Best practice – Form Calculations
Message
De
01/05/2005 23:14:29
 
 
À
01/05/2005 03:03:05
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
01009973
Message ID:
01010073
Vues:
30
Thanks! I appreciate the responses.

Sergey’s approach is the one I am familiar with from DOS days, using memory variables.

I am running into the same problem using either Sergey’s or Glenn & Tore’s method.

The problem is that TxtnTotal is carrying over the total from the previous form when I hit new.

How do I get txtnTotal to initialize to zero for a new record?

Table Junk
Key c 8
Myvalue1 n 10 2
Myvalue2 n 10 2

On form Fields
TxtMyValue1 control source Junk.Myvalue1
TxtMyValue2 control source Junk.Myvalue2
TxtnTotal control source <>

Form::Calculateit
WITH Thisform
.txtnTotal.value = .txtMyValue1.value + .txtmyvalue2.value
ENDWITH

Sergey’s Approch:

Form::Init
DODEFAULT()
Thisform.Calculateit()

TxtMyValue1::Valid
Thisform.Calulateit()

TxtMyValue2::Valid
Thisform.Calulateit()

Glenn & Tore’s Approch:

Form::Init
DODEFAULT()
Bindevent(this.txtMyValue1,”lostfocus”,this,”Calculateit”,1)
Bindevent(this.txtMyValue2,”lostfocus”,this,”Calculateit”,1)
Thisform.Calculateit()
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform