那你写到 BeforeAddDataRow 事件
Dim r As Row = Tables("表A").CurrentIf r IsNot Nothing Then If r.IsNull("附件张数") Then MessageBox.Show("附件张数不允许为空!") e.Cancel = True End If If r("借方") <> r("贷方") Then MessageBox.Show("借贷不平衡!") e.Cancel = True End IfEnd If