以文本方式查看主题

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

--  作者:yifan3429
--  发布时间:2015/1/9 19:46:00
--  单元格约束
有1.2.3.列  如果前面3列没有输入类容 列4不能输入任何数据

求助 老师

--  作者:游
--  发布时间:2015/1/9 21:16:00
--  

PrepareEdit


\'最少有一列有值

If e.Col.Name = "第四列" Then

    If IIF(e.Row.IsNull("第一列"), 1, 0) +  IIF(e.Row.IsNull("第二列"), 1, 0) +  IIF(e.Row.IsNull("第三列"), 1, 0) = 3 Then

        e.Cancel = True

    End If  

End If



\'三列都必须有值

If e.Col.Name = "第四列" Then

    If IIF(e.Row.IsNull("第一列"), 1, 0) +  IIF(e.Row.IsNull("第二列"), 1, 0) +  IIF(e.Row.IsNull("第三列"), 1, 0)> Then

        e.Cancel = True

    End If  

End If