以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  怎样用代码给某列赋值  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=158102)

--  作者:有点蓝
--  发布时间:2020/11/8 20:35:00
--  
代码没有问题,如果要在表格里录入的时候自动计算,应该放到datacolchanged事件,然后这样用

If e.DataCol.Name = "收入金额" orelse e.DataCol.Name = "现金余额" Then
  e.DataRow("应付金额") = e.DataRow("收入金额") + e.DataRow("现金余额")
End
 
If

修改代码后重置一下金额列