以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  [求助]datacolchanged判断语句出错  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=69948)

--  作者:hotday1972
--  发布时间:2015/6/13 11:19:00
--  [求助]datacolchanged判断语句出错

代码为:

Dim lower As Single = Tables("检验明细").Current("Min")
Dim uper As Single = Tables("检验明细").Current("Max")
Dim m As Single = Tables("检验明细").Current("测量值")
Dim b As Boolean
If e.DataCol.Name = "测量值" AndAlso m <> Nothing Then
    If lower <> Nothing Then
        If uper <> Nothing
            b = (m >= lower) And (m <= uper)
        Else
            b = (m >= lower)
        End If
    Else
        If uper <> Nothing Then
            b = (m <= uper)
        End If
    End If
Else
    Tables("检验明细").Current("判别") = ""
End If
If b = True Then
    Tables("检验明细").Current("判别") = "OK"
Else
    Tables("检验明细").Current("判别") = "NG"
End If

 

 

在表中执行时出错,求教问题在哪儿?


--  作者:hotday1972
--  发布时间:2015/6/13 11:20:00
--  
出错信息见附件
图片点击可在新窗口打开查看此主题相关图片如下:捕获1.jpg
图片点击可在新窗口打开查看

--  作者:Bin
--  发布时间:2015/6/13 11:38:00
--  
Else
    Tables("检验明细").Current("判别") = ""
End If
If b = True Then
    Tables("检验明细").Current("判别") = "OK"
Else
    Tables("检验明细").Current("判别") = "NG"
End If

你这一系列代码 , 都没有判断列名.肯定会出问题.