此主题相关图片如下:微信截图_20171127110132.png

老师,
我想让数量这列的条码为空的这一行的值等于 相同门店,编号,库位的数量之和
我在 DataColChanged 如下写了,程序直接崩掉了。要怎么优化呢。。。
If e.DataCol.name = "数量" Then
'If e.DataRow.IsNull("条码") Then
'e.DataRow("数量") = Tables("盘点").Compute("Sum(数量)", "盘点枪编号 = '" & e.DataRow("盘点枪编号") & "' and 库位 = '" & e.DataRow("库位") & "' ")
'End If
For Each r As Row In Tables("盘点").Rows
If r.Isnull("条码") Then
r("数量") = Tables("盘点").Compute("Sum(数量)", "盘点枪编号 = '" & e.DataRow("盘点枪编号") & "' and 库位 = '" & e.DataRow("库位") & "' ")
End If
Next
End If