Foxtable(狐表)用户栏目专家坐堂 → [求助]


  共有2364人关注过本帖树形打印复制链接

主题:[求助]

帅哥哟,离线,有人找我吗?
hotday1972
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:一尾狐 帖子:430 积分:2889 威望:0 精华:0 注册:2015/4/28 21:12:00
[求助]  发帖心情 Post By:2015/6/13 11:09:00 [显示全部帖子]

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

 

这段判断,放在datacolchanged,  为什么程序出错中断?


 回到顶部
帅哥哟,离线,有人找我吗?
hotday1972
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:一尾狐 帖子:430 积分:2889 威望:0 精华:0 注册:2015/4/28 21:12:00
  发帖心情 Post By:2015/6/13 11:10:00 [显示全部帖子]

题目怎么没上去,晕倒!

 回到顶部
帅哥哟,离线,有人找我吗?
hotday1972
  3楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:一尾狐 帖子:430 积分:2889 威望:0 精华:0 注册:2015/4/28 21:12:00
  发帖心情 Post By:2015/6/13 12:09:00 [显示全部帖子]

多谢了,太感谢。我没有大把大把时间连贯学习的,都是零碎时间,学得不到位,见笑了。

 

我有信心学好。e参数我知道,但怎么用还有些糊涂,太感谢狐爸了


 回到顶部
帅哥哟,离线,有人找我吗?
hotday1972
  4楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:一尾狐 帖子:430 积分:2889 威望:0 精华:0 注册:2015/4/28 21:12:00
  发帖心情 Post By:2015/6/13 12:17:00 [显示全部帖子]

以下是引用狐狸爸爸在2015/6/13 11:58:00的发言:

从另一个帖子得知,我还忽视了你没有判断列名的错误,继续改:

 

Dim lower As Single = e.DataRow("Min")
Dim uper As Single = e.DataRow("Max")
Dim m As Single = e.DataRow("测量值")
Dim b As Boolean
If e.DataCol.Name = "测量值"
    If  e.DataRow.IsNull("测量值") = False Then
        If e.DataRow.Isnull("Min") = False Then
            If e.DataRow.Isnull("max") = False Then
                b = (m >= lower) And (m <= uper)
            Else
                b = (m >= lower)
            End If
        Else
            If e.DataRow.Isnull("max") = False Then
                b = (m <= uper)
            End If
        End If
    Else
        e.DataRow("判别") = Nothing
    End If
    If b = True Then
        e.DataRow("判别") = "OK"
    Else
        e.DataRow("判别") = "NG"
    End If
End If

 

帮助特别强调:

http://www.foxtable.com/help/topics/1522.htm

 


[此贴子已经被作者于2015/6/13 12:01:10编辑过]

我有判断列名的“If e.DataCol.Name = "测量值" AndAlso m <> Nothing Then”


 回到顶部