表达式列,不能直接判断
http://www.foxtable.com/help/topics/2381.htm
Dim ztsl As Double '定义变量ztsl,用于存放未到货数量的总和
If e.DataCol.Name = "订单数量" OrElse e.DataCol.Name = "已到货数量" Then '如果列名为orderWdhsl(未到货数量)
For Each dr As DataRow In DataTables("orderList").Select("[orderItemID] = '" & dr("orderItemID") & "'") '在订单表中选择素有物料ID等于当前行物料ID的项目
ztsl = ztsl + dr("orderWdhsl") '变量ztsl等于ztsl加上此行的未到货数量
Next
Dim dr2 As DataRow = DataTables("kcList").Find("[whItemID] = '" & e.DataRow("orderItemID") & "'") '库存表中相同物料ID的在途数量用ztsl变量中的数值来替代
dr2("whzaitu") = ztsl
End If