以文本方式查看主题

-  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=53387)

--  作者:34772849
--  发布时间:2014/7/6 22:58:00
--  输入限制
请教:录入数据时,如果“第二列”不为空,则“第三列”,“第四列”,“第五列”,“第六列”都不能为空,应该怎么实现?在表属性的PrepareEdit还是ValidateEdit里实现?代码是什么?
--  作者:有点甜
--  发布时间:2014/7/6 23:04:00
--  

你在表属性->事件->beforesavedatarow 写代码

 

保存之前检测一下

 

Dim cs() As String = {"第二列", "第三列", "第五列"}
For Each c As String In cs
    If e.DataRow.Isnull(c) Then
        msgbox(c & " 需要填写")
        e.cancel = True
        Return
    End If
Next

[此贴子已经被作者于2014-7-6 23:04:52编辑过]