Private Sub Combo1_LostFocus()
On Error GoTo err
Dim ctl As Control
For Each ctl In Controls
If TypeOf ctl Is TextBox Then
ctl.Text = "0"
End If
Next ctl
If Combo1.ListIndex = -1 Then
Exit Sub
Else
RSCount.Open "select distinct a.考试性质 as ksxz from 成绩表 AS a INNER JOIN 学籍表 AS b ON a.考试号 = b.考试号 Where b.班级 Like " & Combo1.Text, Con, adOpenStatic, , adCmdText
Combo2.Clear
Text1.Text = ""
Combo2.Text = "请选择性质"
Combo2.Enabled = False
If RSCount.EOF = False And RSCount.BOF = False Then
RSCount.MoveFirst
Do While RSCount.EOF = False
Combo2.AddItem RSCount!Ksxz
RSCount.MoveNext
Combo2.Enabled = True
Loop
End If
RSCount.Close
End If
Exit Sub
err:
Call ExecErr(Date, Me.Caption, err.Number, err.Source, err.Description)
End Sub
Private Sub Command1_Click()
On Error GoTo wrong
If Combo1.ListIndex = -1 Or Combo2.ListIndex = -1 Or Text1.Text = "" Then
MsgBox "统计需要项目未完整提供!"
Exit Sub
End If
If Combo3.ListIndex = -1 And (Combo3.Text <> "否" And Combo3.Text <> "是") Then
MsgBox "计外生情况描述不完整!"
Exit Sub
Else
If Combo3.Text = "否" Then
Else
End If
End If
txtZf(9).Text = ""
txtZf(9).Text = txtZf(0).Text * 1 + txtZf(1).Text * 1 + txtZf(2).Text * 1 + txtZf(3).Text * 1 + txtZf(4).Text * 1 + txtZf(5).Text * 1 + txtZf(6).Text * 1 + txtZf(7).Text * 1 + txtZf(8).Text * 1
If Combo3.Text = "否" Then
For i = 0 To 9
If txtZf(i).Text <> 0 Then
RSCount.Open "select count(*) as ywj from 成绩表 AS a INNER JOIN 学籍表 AS b ON a.考试号 = b.考试号 where b.计外 = '" & Combo3.Text & "' and b.班级 like " & Combo1.Text & " and a.考试性质 = '" & Combo2.Text & "' and a." & labXk(i).Caption & " >= " & txtZf(i).Text * 0.6, Con, adOpenStatic, , adCmdText
txtZf(10 + i).Text = RSCount!ywj
txtZf(20 + i).Text = RSCount!ywj / Text1.Text * 100
RSCount.Close
RSCount.Open "select count(*) as ywy from 成绩表 AS a INNER JOIN 学籍表 AS b ON a.考试号 = b.考试号 where b.计外 = '" & Combo3.Text & "' and b.班级 like " & Combo1.Text & " and a.考试性质 = '" & Combo2.Text & "' and a." & labXk(i).Caption & ">=" & txtZf(i).Text * 0.85, Con, adOpenStatic, , adCmdText
txtZf(30 + i).Text = RSCount!ywy
txtZf(40 + i).Text = RSCount!ywy / Text1.Text * 100
RSCount.Close
RSCount.Open "select sum(" & labXk(i).Caption & ") as ywz , count(*) as rs from 成绩表 AS a INNER JOIN 学籍表 AS b ON a.考试号 = b.考试号 where b.计外 = '" & Combo3.Text & "' and b.班级 like " & Combo1.Text & " and a.考试性质 = '" & Combo2.Text & "'", Con, adOpenStatic, , adCmdText
txtZf(50 + i).Text = RSCount!ywz
txtZf(60 + i).Text = RSCount!ywz / Text1.Text
txtZf(70 + i).Text = txtZf(20
首页 上一页 6 7 8 9 10 11 12 下一页 尾页 9/14/14
电子教务管理系统vb(九)由毕业论文网(www.huoyuandh.com)会员上传。