以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  [求助]怎样限制列输入数据  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=68183)

--  作者:wusim
--  发布时间:2015/5/12 7:25:00
--  [求助]怎样限制列输入数据
怎样限制列输入数据?有A、B两列,当A小于等于1时,B不能输入大于3,反之不能输入大于5。
--  作者:Bin
--  发布时间:2015/5/12 8:32:00
--  
datacolchanging

select case e.datacol.name
         case "B"
            if e.datarow("A") <1 then
                 if e.newValue > 3 then
                     e.cancel=true
                 end if
            else
                if e.newValue > 5 then
                     e.cancel=true
                 end if
            end if
end select

--  作者:wusim
--  发布时间:2015/5/12 21:05:00
--  
如果增加C列,当A小于等于1时,C不能输入大于6,反之不能输入大于10。怎样增加语句?
--  作者:大红袍
--  发布时间:2015/5/12 21:08:00
--  
Select Case e.DataCol.name
    Case "B"
        If e.DataRow("A") <1 Then
            If e.newValue > 3 Then
                e.cancel=True
            End If
        Else
            If e.newValue > 5 Then
                e.cancel=True
            End If
        End If
    Case "C"
        If e.DataRow("A") <= 1 Then
            If e.newValue > 6 Then
                e.cancel=True
            End If
        Else
            If e.newValue > 10 Then
                e.cancel=True
            End If
        End If
End Select