WHKUM 发表于:2008-01-17 21:30:37
varBalance = 0
'使用Do Loop循环在表记录集合中逐笔往下计算本日余额
Do Until rs1.EOF
'rs1.CancelUpdate
rs1("海运费USD余额") = rs1!海运费USD - rs1!付款USD + varBalance
rs1("海运费RMB余额") = rs1!海运费RMB - rs1!付款RMB + varBalance
rs1("发票USD余额") = rs1!海运费USD - rs1!发票USD + varBalance
rs1("发票RMB余额") = rs1!海运费RMB - rs1!发票RMB + varBalance
rs1("未付款余额") = rs1!合计 - rs1!付款金额 + varBalance
rs1("发票余额") = rs1!合计 - rs1!发票金额 + varBalance
rs1.Update
varBalance = rs1!海运费USD余额
varBalance = rs1!海运费RMB余额
varBalance = rs1!发票USD余额
varBalance = rs1!发票RMB余额
varBalance = rs1!未付款余额
varBalance = rs1!发票余额
rs1.MoveNext
Loop
'MsgBox "余额栏已替你补好了,你不必自己计算"
rs1.Close
感觉这种效率低,不如每次保存时,将余额计算好,保存起来。