【VB开源代码栏目提醒】:网学会员鉴于大家对VB开源代码十分关注,论文会员在此为大家搜集整理了“B学生查询.frm”一文,供大家参考学习
VERSION 5.00
Begin VB.Form frmStQuery
Caption = "学生查询"
ClientHeight = 2550
ClientLeft = 3825
ClientTop = 3900
ClientWidth = 8835
LinkTopic = "Form1"
ScaleHeight = 2550
ScaleWidth = 8835
Begin VB.CommandButton CmdExit
Caption = "退出"
Height = 435
Left = 7500
TabIndex = 13
Top = 1920
Width = 915
End
Begin VB.Frame Frame1
Caption = "查询条件"
Height = 1815
Index = 0
Left = 0
TabIndex = 0
Top = 0
Width = 8595
Begin VB.CommandButton CmdOpertion
Caption = "新生注册"
Height = 555
Index = 0
Left = 420
TabIndex = 12
Top = 900
Width = 1095
End
Begin VB.CommandButton CmdOpertion
Caption = "学期注册"
Height = 555
Index = 1
Left = 1728
TabIndex = 11
Top = 900
Width = 1095
End
Begin VB.CommandButton CmdOpertion
Caption = "基本信息"
Height = 555
Index = 2
Left = 3036
TabIndex = 10
Top = 900
Width = 1095
End
Begin VB.CommandButton CmdOpertion
Caption = "学籍异动"
Height = 555
Index = 4
Left = 5652
TabIndex = 9
Top = 900
Width = 1095
End
Begin VB.CommandButton CmdOpertion
Caption = "学籍报告"
Height = 555
Index = 5
Left = 6960
TabIndex = 8
Top = 900
Width = 1095
End
Begin VB.CommandButton CmdOpertion
Caption = "成员信息"
Height = 555
Index = 3
Left = 4344
TabIndex = 7
Top = 900
Width = 1095
End
Begin VB.ComboBox CboQuery
Height = 315
Index = 1
Left = 3600
TabIndex = 3
Top = 360
Width = 2055
End
Begin VB.ComboBox CboQuery
Height = 315
Index = 0
Left = 840
TabIndex = 2
Top = 360
Width = 2295
End
Begin VB.ComboBox CboQuery
Height = 315
Index = 2
Left = 6360
TabIndex = 1
Top = 360
Width = 1815
End
Begin VB.Label Label9
Caption = "系:"
Height = 240
Left = 3240
TabIndex = 6
Top = 360
Width = 735
End
Begin VB.Label Label8
Caption = ":"
Height = 255
Index = 0
Left = 240
TabIndex = 5
Top = 360
Width = 735
End
Begin VB.Label Label1
Caption = "班级:"
Height = 255
Left = 5760
TabIndex = 4
Top = 360
Width = 735
End
End
End
Attribute VB_Name = "frmStQuery"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim SQLStr As String
Dim msg As String
Public strQuery As String
Private Sub SelectData(Index As Integer)
Dim rst As ADODB.Recordset
Dim strItem As String
'初始化系ComboBox
If Index = 0 Then '如果是选择院
SQLStr = " select departmentID,nameD from 系信息表 where collegeID='"
SQLStr = SQLStr & Left(Trim(CboQuery(0).Text), 2) & "' order by departmentID"
Set rst = SelectSQL(SQLStr, msg)
CboQuery(1).Clear
If rst.RecordCount > 0 Then
Do While Not rst.EOF
strItem = rst.Fields(0) & " " & rst.Fields(1)
CboQuery(1).AddItem (strItem)
rst.MoveNext
Loop
rst.Close
CboQuery(1).ListIndex = 0
Else
Exit Sub
End If
ElseIf Index = 1 Then '如果是选择系
SQLStr = " select classID,classname from 班级信息表 where departmentID='"
SQLStr = SQLStr & Left(Trim(CboQuery(1).Text), 4) & "' order by classID"
Set rst = SelectSQL(SQLStr, msg)
CboQuery(2).Clear
If rst.RecordCount > 0 Then
Do While Not rst.EOF
strItem = rst.Fields(0) & " " & rst.Fields(1)
CboQuery(2).AddItem (strItem)
rst.MoveNext
Loop
rst.Close
CboQuery(2).ListIndex = 0
Else
Exit Sub
End If
End If
End Sub
Private Sub CboQuery_Click(Index As Integer)
If Index = 0 Then
Call SelectData(0) '得到系列表
ElseIf Index = 1 Then
If CboQuery(1).ListCount > 0 Then
Call SelectData(1) '得到班级列表
End If
End If
End Sub
Private Sub CmdExit_Click()
'退出操作
Unload Me
frmMain.Enabled = True
End Sub
Private Sub CmdOpertion_Click(Index As Integer)
If CboQuery(2).ListCount > 0 Then
strQuery = Left(Trim(CboQuery(2).Text), 6)
Select Case Index
Case 0 '新生注册
frmInfo.Show
frmStQuery.Enabled = False
Case 1 '学期注册
frmSemesterReg.Show
frmStQuery.Enabled = False
Case 2 '基本信息
frmInfo.Show
frmStQuery.Enabled = False
Case 3 '成员信息
frmMember.Show
frmStQuery.Enabled = False
Case 4 '学籍异动
frmStchange.Show
frmStQuery.Enabled = False
Case 5 '学籍报表
frmStReport.Show
frmStQuery.Enabled = False
End Select
Else
MsgBox ("没有班级信息!")
End If
End Sub
Private Sub Form_Load()
Dim rst As ADODB.Recordset
Dim strItem As String
'确定按钮操作
For Index = 0 To 5
CmdOpertion(Index).Enabled = False
Next Index
If MenuIndex = 0 Then
CmdOpertion(0).Enabled = True
CmdOpertion(1).Enabled = True
Else
CmdOpertion(MenuIndex).Enabled = True
End If
'初始化ComboBox
SQLStr = " select collegeID,nameC from 院信息表 order by collegeID"
Set rst = SelectSQL(SQLStr, msg)
If rst.RecordCount > 0 Then
Do While Not rst.EOF
strItem = rst.Fields(0) & " " & rst.Fields(1)
CboQuery(0).AddItem (strItem)
rst.MoveNext
Loop
rst.Close
CboQuery(0).ListIndex = 0
Else
MsgBox ("请先创建院信息!") '如果没有院信息不能使用
CboQuery(0).Enabled = False
CboQuery(1).Enabled = False
CboQuery(2).Enabled = False
Exit Sub
End If
Call SelectData(0) '得到系列表
If CboQuery(1).ListCount > 0 Then
Call SelectData(1) '得到班级列表
End If
End Sub
Private Sub Form_Unload(Cancel As Integer)
'退出操作
Unload Me
frmMain.Enabled = True
End Sub
上一篇:
B学期注册.frm
下一篇:
ASP小区停车管理系统(Access)(含录像)