Dim qujian1 As WinForm.TextBox = e.Form.Controls("TextBox1")
If qujian1.Value Is Nothing Then
MessageBox.Show("请至少设置一个区间!","提示",MessageBoxButtons.OK,MessageBoxIcon.Error)
Else
Dim idx As Integer
For i As Integer = 4 To 1 Step -1
Dim txt As WinForm.TextBox = e.Form.controls("Textbox" & i)
If txt.text > "" Then
idx = i
Exit For
End If
Next
For Each dr As DataRow In DataTables("表B").Select("")
For i As Integer = idx To 1 Step -1
Dim txt As WinForm.TextBox = e.Form.controls("Textbox" & i)
If txt.text > "" Then
If i = idx Then
If dr("分数") >= val(txt.Text) Then
dr("等级") = txt.text & "分以上"
Exit For
End If
Else
If dr("分数") >= val(txt.Text) Then
dr("等级") = txt.text & " - " & e.form.controls("Textbox" & i+1).Text & "分"
Exit For
ElseIf i = 1 Then
If dr("分数") <= val(txt.Text) Then
dr("等级") = txt.text & "分以下"
Exit For
End If
End If
End If
End If
Next
Next
End If