表结构如下
此主题相关图片如下:1.jpg


此主题相关图片如下:2.jpg

代码
If e.DataCol.name = "五十米跑值"
If e.DataRow("五十米跑值") < 0 OrElse e.DataRow("五十米跑值") > 10
MessageBox.show("对不起,实测数据不合法,请重新输入!")
e.DataRow("五十米跑值") = Nothing
Return
End If
End If
If e.DataCol.name = "年级" OrElse e.DataCol.name = "性别" OrElse e.DataCol.name = "五十米跑值" Then
If e.DataRow.isnull("年级") = False And e.DataRow.isnull("性别") = False And e.DataRow.isnull("五十米跑值") = False Then
Dim dr As DataRow = DataTables("五十米跑标准").find("年级 ='" & e.DataRow("年级") & "' and 性别 ='" & e.DataRow("性别") & "' and 下限 <= " & e.DataRow("五十米跑值") & " and 上限 >= " & e.DataRow("五十米跑值"))
If dr IsNot Nothing
e.DataRow("五十米跑等级") = dr("五十米跑等级")
e.DataRow("五十米跑分数") = dr("五十米跑分数")
End If
End If
End If
报错
此主题相关图片如下:3.jpg

而且计算记过也不对
输入7.1不报错,但是算的结果不对