var goodsgold:double; begin goodsgold:=0; wwtable1.open; wwtable1.first; while not wwtable1.eof do begin goodsgold:=goodsgold+wwtable1.fieldbyname('金额').asfloat; label1.caption:=formatfloat('0.00',goodsgold); end; 不能写在OnCalcFields事件里。
var goodsgold:double; begin goodsgold:=0; wwtable1.open; wwtable1.first; while not wwtable1.eof do begin goodsgold:=goodsgold+wwtable1.fieldbyname('金额').asfloat; label1.caption:=formatfloat('0.00',goodsgold); wwtable1.next; end; 不能写在OnCalcFields事件里。 刚刚忘记了一句。