'项目事件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