beforesavedatarow事件,写代码
Dim fdr As DataRow = DataTables("表A").find("编码='" & e.DataRow("编码") & "'")
If fdr IsNot Nothing Then
If fdr("数量") = True Then
If e.DataRow.IsNull("数量") Then
msgbox("数量不能为空")
Tables("表B").Select(Tables("表B").FindRow(e.DataRow), Tables("表B").Cols("数量").Index)
e.cancel = True
End If
End If
If fdr("部门") = True Then
If e.DataRow.IsNull("部门") Then
msgbox("部门不能为空")
Tables("表B").Select(Tables("表B").FindRow(e.DataRow), Tables("表B").Cols("部门").Index)
e.cancel = True
End If
End If
If fdr("客户") = True Then
If e.DataRow.IsNull("客户") Then
msgbox("客户不能为空")
Tables("表B").Select(Tables("表B").FindRow(e.DataRow), Tables("表B").Cols("客户").Index)
e.cancel = True
End If
End If
End If