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 转换无效,不知道代码哪里需要改动,谢谢。
|