老师给提示一下,,这个出库明细会统计当前行输入的数量,,=是出库明细统计了2变,要怎么处理
If e.DataCol.name = "数量" Then
Dim rks As Integer = DataTables("采购入库").Compute("Sum(数量)", "条码='" & e.DataRow("条码") & "'") - DataTables("出库明细").Compute("Sum(数量)", "条码='" & e.DataRow("条码") & "'") + DataTables("退货明细").Compute("Sum(数量)", "条码='" & e.DataRow("条码") & "'")
If e.newvalue > rks Then
e.newvalue = Nothing
msgbox("库存不足!")
e.cancel = True
End If
End If