以文本方式查看主题

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

--  作者:wu725
--  发布时间:2019/11/7 18:08:00
--  设置输入数据有效性

狐表能否实现数据有效性设置,指定列只允许输入等于小于10的数据,大于10的无法输入,允许空值。

 

第一列    第二列

10         9

8           10

9           8

7           5

            12

6

12         6

13         8

注:12和13不允许输入,或提示红色。


--  作者:狐狸爸爸
--  发布时间:2019/11/7 20:05:00
--  
这是基本功能,DataColChanging事件:

select case e.DataCol.Name
    case "第一列","第二列"
        if  e.Value > 10 then
            e.Cancel = True
        End if
end select


  

--  作者:wu725
--  发布时间:2019/11/8 9:23:00
--  

谢谢狐狸爸爸,我修改了一下可以用了。

Select Case e.DataCol.Name
    Case "依法履职","服务发展","作风建设","政府公开","办事效率","清正廉洁"
        If  e.NewValue > 10 Then
            e.Cancel = True
        End If
End Select