Dim s1,s2,s3,sum1 As double
s1 = DataTables("期初库存").Compute("Sum(重量)","[克重] = " & e.DataRow("克重") and "[编号] = '" & e.DataRow("编号") & "'" and "[幅宽] = " & e.DataRow("幅宽"))
s2 = DataTables("生产清单").Compute("Sum(重量)","[克重] = " & e.DataRow("克重") and "[编号] = '" & e.DataRow("编号") & "'" and "[幅宽] = " & e.DataRow("幅宽"))
s3 = DataTables("发货清单").Compute("Sum(重量)","[克重] = " & e.DataRow("克重") and "[编号] = '" & e.DataRow("编号") & "'" and "[幅宽] = " & e.DataRow("幅宽"))
sum1=s1+s2-s3
e.Datarow("重量") =Sum1
库存表的一个计算公式,“克重”列改变时弹出窗口说 字符串 到long 转换无效,不知道代码哪里需要改动,谢谢。
Dim s1,s2,s3 As double
Dim dr As DataRow = e.DataRow
Dim s As String = "[克重] = " & dr("克重") & " And [编号] = '" & dr("编号") & "' And [幅宽] = " & dr("幅宽")
s1 = DataTables("期初库存").Compute("Sum(重量)",s)
s2 = DataTables("生产清单").Compute("Sum(重量)",s)
s3 = DataTables("发货清单").Compute("Sum(重量)",s)
dr("重量") = s1+s2-s3
[此贴子已经被作者于2009-8-3 0:41:43编辑过]