If MessageBox.show("确定保存验收结果吗?","提示",MessageBoxButtons.YesNo) = DialogResult.Yes Then Dim a As Integer For Each r1 As Row In Tables("收货验收") Dim r2 As Row = Tables("入库单明细").FindRow("明细ID"=r1("入库单明细ID")) a = Tables("入库单明细").FindRow(r2.Index = r1("入库单明细ID")) r2("已收数量") = r2("已收数量") + r1("收货数量") Next End If