以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  新增行问题  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=123500)

--  作者:aza520
--  发布时间:2018/8/16 9:35:00
--  新增行问题
在表的BeforeAddDataRow事件设如下代码,
If e.DataRow.IsNull("项目名称") Or e.DataRow.IsNull("县") Or e.DataRow.IsNull("单位名称") Then \'判断是否不符合验证要求
    e.Cancel = True \'那么取消输入并提示用户
    Messagebox.Show("项目名称,县区,单位未输入完整内容,不能增加新行!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
End If

提示如下错误:
.NET Framework 版本:2.0.50727.8831
Foxtable 版本:2017.12.18.1
错误所在事件:S记录杆管,BeforeAddDataRow
详细错误信息:
未将对象引用设置到对象的实例。

--  作者:有点甜
--  发布时间:2018/8/16 9:38:00
--  
Dim fdr = e.DataTable.find("项目名称 is null or 县 is null or 单位名称 is null")
If fdr IsNot Nothing Then \'判断是否不符合验证要求
    e.Cancel = True \'那么取消输入并提示用户
    Messagebox.Show("项目名称,县区,单位未输入完整内容,不能增加新行!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
End If