⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 b学生注册.frm

📁 人事管理系统:包括员工公资的管理,考勤的管理,还有各种考核等功能
💻 FRM
字号:
VERSION 5.00
Begin VB.Form B学生查询2 
   Caption         =   "学生查询"
   ClientHeight    =   2385
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   5295
   LinkTopic       =   "Form1"
   ScaleHeight     =   2385
   ScaleWidth      =   5295
   StartUpPosition =   3  'Windows Default
   Begin VB.Frame Frame1 
      Caption         =   "查询条件"
      Height          =   2055
      Index           =   0
      Left            =   120
      TabIndex        =   0
      Top             =   120
      Width           =   5055
      Begin VB.CommandButton CmdBaseInfo 
         Caption         =   "基本信息"
         Height          =   375
         Left            =   3480
         TabIndex        =   10
         Top             =   1080
         Width           =   975
      End
      Begin VB.CommandButton CmdExit 
         Caption         =   "退出"
         Height          =   375
         Left            =   3480
         TabIndex        =   9
         Top             =   1560
         Width           =   975
      End
      Begin VB.ComboBox CboQuery 
         Height          =   315
         Index           =   2
         Left            =   960
         TabIndex        =   8
         Top             =   1320
         Width           =   2055
      End
      Begin VB.CommandButton CmdOldRegister 
         Caption         =   "学期注册"
         Height          =   375
         Left            =   3480
         TabIndex        =   7
         Top             =   720
         Width           =   975
      End
      Begin VB.CommandButton CmdNewRegister 
         Caption         =   "新生注册"
         Height          =   375
         Left            =   3480
         TabIndex        =   3
         Top             =   360
         Width           =   975
      End
      Begin VB.ComboBox CboQuery 
         Height          =   315
         Index           =   0
         Left            =   960
         TabIndex        =   2
         Top             =   360
         Width           =   2055
      End
      Begin VB.ComboBox CboQuery 
         Height          =   315
         Index           =   1
         Left            =   960
         TabIndex        =   1
         Top             =   840
         Width           =   2055
      End
      Begin VB.Label Label1 
         Caption         =   "班级:"
         Height          =   255
         Left            =   315
         TabIndex        =   6
         Top             =   1320
         Width           =   735
      End
      Begin VB.Label Label8 
         Caption         =   "学院:"
         Height          =   255
         Index           =   0
         Left            =   360
         TabIndex        =   5
         Top             =   360
         Width           =   735
      End
      Begin VB.Label Label9 
         Caption         =   "系:"
         Height          =   240
         Left            =   480
         TabIndex        =   4
         Top             =   840
         Width           =   735
      End
   End
End
Attribute VB_Name = "B学生查询2"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim SQL As String
Dim msg As String
Public strQuery As String
Public CmdType As String
Private Sub SelectData(Index As Integer)
  Dim rst As ADODB.Recordset
  Dim strItem As String
'初始化系ComboBox
If Index = 0 Then '如果是选择院
    SQL = " select 系代码,系名称 from 系信息表 where 院代码='"
    SQL = SQL & Left(Trim(CboQuery(0).Text), 2) & "' order by  系代码"
    Set rst = SelectSQL(SQL, 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 '如果是选择系
    SQL = " select 班号,班级名称 from 班级信息表 where 系代码='"
    SQL = SQL & Left(Trim(CboQuery(1).Text), 4) & "' order by  班号"
    Set rst = SelectSQL(SQL, 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 CmdBaseInfo_Click()
If CboQuery(2).ListCount > 0 Then
    strQuery = Left(Trim(CboQuery(2).Text), 6)
    CmdType = "new"
    B基本信息.Show
    B学生注册.Enabled = False
Else
    MsgBox ("没有班级信息!")
End If
End Sub

Private Sub CmdNewRegister_Click()
If CboQuery(2).ListCount > 0 Then
    strQuery = Left(Trim(CboQuery(2).Text), 6)
    CmdType = "new"
    B基本信息.Show
    B学生注册.Enabled = False
Else
    MsgBox ("没有班级信息!")
End If
End Sub
Private Sub CmdOldRegister_Click()
If CboQuery(2).ListCount > 0 Then
    strQuery = Left(Trim(CboQuery(2).Text), 6)
    CmdType = "old"
    B学期注册.Show
    B学生注册.Enabled = False
Else
    MsgBox ("没有班级信息!")
End If
End Sub

Private Sub CmdExit_Click()
'退出操作
Unload Me
学生档案管理.Enabled = True
End Sub

Private Sub Form_Load()
'初始化ComboBox
Dim rst As ADODB.Recordset
Dim strItem As String
SQL = " select 院代码,院名称 from 院信息表 order by 院代码"
Set rst = SelectSQL(SQL, 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
学生档案管理.Enabled = True
End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -