7.1.2 打印统计
运行打印统计后可以按条件把符合条件的各种信息以报表形式罗列出来,各种信息还可以以打印出来或以报表形式保存。打印统计包括班级统计分析、档案统计分析、课程统计分析、成绩统计分析和交费统计分析五类。
班级统计分析(如:界面如图四)
(图四)
代码如下:
Private Sub Command1_Click()
Dim SQLoriginal As String
Dim SQLadd As String
Dim SQLorder As String
Dim strSql As String
SQLoriginal = "SELECT 年级,专业,人数,辅导员,备注 FROM 班级表 "
SQLadd = "WHERE 年级=年级 AND 专业=专业 "
SQLorder = ""
If Check1.Value = 1 And IsNumeric(Text1) Then
SQLadd = SQLadd + "and 年级='" + Text1 + "'"
End If
If Check2.Value = 1 And Not IsNull(Text2) Then
SQLadd = SQLadd + "and 专业='" + Text2 + "'"
End If
If Check3.Value = 1 And IsNumeric(Text3) Then
SQLadd = SQLadd + "and 人数='" + Text3 + "'"
End If
If Check4.Value = 1 And Not IsNull(Text4) Then
SQLadd = SQLadd + "and 辅导员='" + Text4 + "'"
End If
strSql = SQLoriginal + SQLadd + SQLorde
If Dat_Main.rsDat_Class.State = 1 Then
Dat_Main.rsDat_Class.Close
End If
Dat_Main.rsDat_Class.Open strSql
Dat_Class.Show vbModal
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Form_Load()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
End Sub
Private Sub Text1_Change()
End Sub
Private Sub Text3_Change()
End Sub
档案分析统计(如:界面如图五)
(图五)
代码如下:
Private Sub Command1_Click()
Dim SQLoriginal As String
Dim SQLadd As String
Dim SQLorder As String
Dim strSql As String
On Error Resume Next
SQLoriginal = "SELECT * FROM 学生档案 "
SQLadd = "WHERE 学号=学号 AND 姓名=姓名 "
SQLorder = ""
If Check1.Value = 1 And IsNumeric(Text1) Then
SQLadd = SQLadd + "and 学号='" + Text1 + "'"
End If
If Check2.Value = 1 And Not IsNull(Text2) Then
SQLadd = SQLadd + "and 姓名='" + Text2 + "'"
End If
If Check3.Value = 1 And Not IsNull(Text3) Then
SQLadd = SQLadd + "and 专业='" + Text3 + "'"
End If
If Check4.Value = 1 And IsDate(DTPicker1) Then
SQLadd = SQLadd + " and 出生年月= # " & DTPicker1.Value & "#"
End If
strSql = SQLoriginal + SQLadd + SQLorde
If Dat_Main.rsDat_Strudent.State = 1 Then
Dat_Main.rsDat_Strudent.Close
End If
Dat_Main.rsDat_Strudent.Open strSql
Dat_Strudent.Show vbModal
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Form_Load()
'Combo1.AddItem ("男")
上一页 [1] [2] [3] [4] [5] [6] [7] [8] 下一页