Dim r As Row = Tables("产品出库表").Current If r.Isnull("入库单号") = False Then If MessageBox.Show("是否删除?","请确认",MessageBoxButtons.YesNo,MessageBoxIcon.Question) = DialogResult.Yes Then Dim pr As DataRow pr = DataTables("产品入库表").Find("入库单号 = '" & r("入库单号") & "'") If pr IsNot Nothing Then pr("剩余库存") = pr("剩余库存") + r("实交数量") r.Delete End If Else r.Delete End If End If