Rss & SiteMap
Foxtable(狐表) http://www.foxtable.com
If e.DataRow.IsNull("基本单位") Then '基本单位为空时不能保存
Tables("货品资料").filter = "[基本单位] Is Null"
messagebox.show("基本单位不能为空")
e.Cancel = True '
End If
选择其它数据表前执行上面代码,请问如何设置?
解决了.
'项目事件MainTableChanging
If e.NewTableName <> "货品资料" AndAlso e.OldTableName = "货品资料" Then
Dim dr As DataRow
dr = DataTables("货品资料").Find("[基本单位] Is Null")
If dr IsNot Nothing Then '
e.Cancel = True
Tables("货品资料").filter = "[基本单位] Is Null"
messagebox.show("基本单位不能为空")
End If
End If
这样能避免多个表同时出现列空值不能保存需要每个表检查的情况.