If e.DataCol.name = "数量" Then For Each r As DataRow In e.DataTable.Select("条码 is null and 盘点枪编号 = '" & e.DataRow("盘点枪编号") & "' and 库位 = '" & e.DataRow("库位") & "' ") Systemready = False r("数量") = Tables("盘点").Compute("Sum(数量)", "盘点枪编号 = '" & e.DataRow("盘点枪编号") & "' and 库位 = '" & e.DataRow("库位") & "' ") Systemready = True Next End If