General information
Category:
Forms & Form designer
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()
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only