从另一个帖子得知,我还忽视了你没有判断列名的错误,继续改:
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编辑过]