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

📄 frmstudentq.frm

📁 北大青鸟教学管理系统是学习规范编程范本.功能非常完备,代码编写有章法,不可多得
💻 FRM
📖 第 1 页 / 共 2 页
字号:
         TabIndex        =   26
         Top             =   3120
         Width           =   360
      End
      Begin VB.Label Label4 
         AutoSize        =   -1  'True
         Caption         =   "状态"
         Height          =   180
         Index           =   16
         Left            =   4800
         TabIndex        =   25
         Top             =   2100
         Width           =   360
      End
      Begin VB.Label Label4 
         AutoSize        =   -1  'True
         Caption         =   "意向岗位"
         Height          =   180
         Index           =   17
         Left            =   240
         TabIndex        =   24
         Top             =   2466
         Width           =   720
      End
      Begin VB.Label Label4 
         AutoSize        =   -1  'True
         Caption         =   "意向城市"
         Height          =   180
         Index           =   18
         Left            =   2640
         TabIndex        =   23
         Top             =   2100
         Width           =   720
      End
      Begin VB.Label Label4 
         AutoSize        =   -1  'True
         Caption         =   "联系电话"
         Height          =   180
         Index           =   19
         Left            =   240
         TabIndex        =   22
         Top             =   2105
         Width           =   720
      End
      Begin VB.Label Label4 
         AutoSize        =   -1  'True
         Caption         =   "姓名"
         Height          =   180
         Index           =   9
         Left            =   2640
         TabIndex        =   21
         Top             =   300
         Width           =   360
      End
      Begin VB.Label Label4 
         AutoSize        =   -1  'True
         Caption         =   "性别"
         Height          =   180
         Index           =   3
         Left            =   240
         TabIndex        =   20
         Top             =   661
         Width           =   360
      End
      Begin VB.Label Label4 
         AutoSize        =   -1  'True
         Caption         =   "姓名拼音"
         Height          =   180
         Index           =   2
         Left            =   4800
         TabIndex        =   19
         Top             =   300
         Width           =   720
      End
      Begin VB.Label Label4 
         AutoSize        =   -1  'True
         Caption         =   "学号"
         Height          =   180
         Index           =   1
         Left            =   240
         TabIndex        =   18
         Top             =   300
         Width           =   360
      End
      Begin VB.Label Label4 
         AutoSize        =   -1  'True
         Caption         =   "家庭住址"
         Height          =   180
         Index           =   13
         Left            =   240
         TabIndex        =   17
         Top             =   2830
         Width           =   720
      End
      Begin VB.Label Label4 
         AutoSize        =   -1  'True
         Caption         =   "邮政编码"
         Height          =   180
         Index           =   12
         Left            =   4800
         TabIndex        =   16
         Top             =   1740
         Width           =   720
      End
   End
   Begin MSFlexGridLib.MSFlexGrid MsflxStuinfo 
      Height          =   1935
      Left            =   120
      TabIndex        =   48
      Top             =   240
      Width           =   6975
      _ExtentX        =   12303
      _ExtentY        =   3413
      _Version        =   393216
      Rows            =   3
      Cols            =   6
      FixedRows       =   2
      FocusRect       =   0
      SelectionMode   =   1
      AllowUserResizing=   1
   End
End
Attribute VB_Name = "frmStudentQ"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Public strSearch As String

Private Sub cmdClose_Click()
    Unload Me
End Sub

Private Sub cmdCondition_Click()
    frmSearch.Show vbModal
End Sub

Private Sub cmdSearch_Click()
    Dim intIndex
On Error GoTo Err
    Do While MsflxStuinfo.Rows > 3  '以下8行为清空列表
        MsflxStuinfo.RemoveItem MsflxStuinfo.Rows - 1
    Loop
    MsflxStuinfo.Row = 2
    For intIndex = 0 To 5
        MsflxStuinfo.Col = intIndex
        MsflxStuinfo.Text = Empty
    Next intIndex
    
    Set Rst = Nothing               '清空记录集
    If Fun_Rst("studentinfo") Then
        Rst.Filter = (strSearch)
        If Rst.BOF = True And Rst.EOF = True Then
            cmdLast.Enabled = False
            cmdFirst.Enabled = False
            cmdPrevious.Enabled = False
            cmdNext.Enabled = False
            MsgBox "没有任何记录....", vbInformation + vbOKOnly, "检索记录"
        Else
            Do While Rst.EOF = False
                MsflxStuinfo.Row = MsflxStuinfo.Rows - 1
                MsflxStuinfo.Col = 0
                MsflxStuinfo.Text = MsflxStuinfo.Rows - 2   '序号
                MsflxStuinfo.Col = 1
                MsflxStuinfo.Text = Rst.Fields("studentno")
                MsflxStuinfo.Col = 2
                MsflxStuinfo.Text = Rst.Fields("name")
                MsflxStuinfo.Col = 3
                MsflxStuinfo.Text = Rst.Fields("sex")
                MsflxStuinfo.Col = 4
                MsflxStuinfo.Text = Rst.Fields("classno")
                MsflxStuinfo.Col = 5
                MsflxStuinfo.Text = Rst.Fields("Address")

                Rst.MoveNext
                If Rst.EOF = False Then
                    MsflxStuinfo.AddItem Empty
                End If
            Loop
            MsflxStuinfo.Row = 2
            Call DisplayInfo
            cmdLast.Enabled = True
            cmdFirst.Enabled = True
            cmdPrevious.Enabled = True
            cmdNext.Enabled = True
            MsgBox "信息检索成功....", vbInformation + vbOKOnly, "信息检索"

        End If
    Else
        MsgBox "信息检索失败", vbInformation + vbOKOnly, "检索"
    End If
    Exit Sub
Err:
    If Err.Number = 94 Then
        Resume Next
    Else
        MsgBox "未知错误:" & Err.Description & vbCrLf & "错误代号:" & Err.Number, vbCritical + vbOKOnly, "未知错误"
    End If
End Sub





Private Sub Form_Load()
Dim intIndex As Integer
    strSearch = Empty   '清空查询条件
    '初始化msflexgrid
    MsflxStuinfo.MergeCells = flexMergeFree
    MsflxStuinfo.Rows = 3
    MsflxStuinfo.FixedRows = 2
    MsflxStuinfo.Row = 0
    MsflxStuinfo.ColWidth(0) = 600                '设定第一列宽为600
    For intIndex = 1 To MsflxStuinfo.Cols - 1
        MsflxStuinfo.Col = intIndex
        MsflxStuinfo.Text = "学员信息列表"
        MsflxStuinfo.ColWidth(intIndex) = 1200

    Next intIndex
    MsflxStuinfo.MergeRow(0) = True
    
    MsflxStuinfo.Row = 1
    MsflxStuinfo.Col = 0
    MsflxStuinfo.Text = "序号"
    
    MsflxStuinfo.Col = 1
    MsflxStuinfo.Text = "学号"
    
    MsflxStuinfo.Col = 2
    MsflxStuinfo.Text = "姓名"

    MsflxStuinfo.Col = 3
    MsflxStuinfo.Text = "性别"
            
    MsflxStuinfo.Col = 4
    MsflxStuinfo.Text = "班级编号"
    
    MsflxStuinfo.Col = 5
    MsflxStuinfo.Text = "家庭住址"

End Sub

Sub DisplayInfo()
On Error GoTo Err
    MsflxStuinfo.Col = 1
    Rst.MoveFirst
    Rst.Filter = "studentno='" & MsflxStuinfo.Text & "'"
    txtStuNo = Rst.Fields("studentno").Value
    txtStuName = Rst.Fields("name").Value
    txtStuNamePY = Rst.Fields("py").Value
    txtsex = Rst.Fields("sex")
    txtClassNo = Rst.Fields("classno")
    txtDegree = Rst.Fields("degree")
    txtIdentity = Rst.Fields("identityno")
    txtSchool = Rst.Fields("school")
    txtSpecialty = Rst.Fields("specialty")
    txtCertificate = Rst.Fields("certificate")
    txtJobStatus = Rst.Fields("jobstatus")
    If IsNull(Rst.Fields("jobunit").Value) Then
        txtJobUnit = Empty
    Else
        txtJobUnit = Rst.Fields("jobunit")
    End If
    If Rst.Fields("jobtype") <> "" Then
        txtJobType = Rst.Fields("jobtype")
    Else
        txtJobType = Empty
    End If
    txtMaincode = Rst.Fields("maincode")
    txtTel = Rst.Fields("Tel")
    If Rst.Fields("tocity") <> "" Then
        txtToCity = Rst.Fields("tocity")
    Else
        txtToCity = Empty
    End If
    txtStatus = Rst.Fields("status")
    If Rst.Fields("topost") <> "" Then
        txtToPost = Rst.Fields("topost")
    Else
        txtToPost = Empty
    End If
    txtAddress = Rst.Fields("Address")
    If Rst.Fields("remark") <> "" Then
        txtRemark = Rst.Fields("Remark")
    Else
        txtRemark = Empty
    End If
    
    Dim intCol As Integer
    Dim intRow As Integer
    Dim TmpRow As Integer
    TmpRow = MsflxStuinfo.Row
    For intRow = 2 To MsflxStuinfo.Rows - 1
        MsflxStuinfo.Row = intRow
        If TmpRow = intRow Then
            For intCol = 1 To MsflxStuinfo.Cols - 1
                MsflxStuinfo.Col = intCol
                MsflxStuinfo.CellForeColor = vbYellow
                MsflxStuinfo.CellBackColor = &H8000000D
            Next intCol
        Else
            For intCol = 1 To MsflxStuinfo.Cols - 1
                MsflxStuinfo.Col = intCol
                MsflxStuinfo.CellBackColor = vbWhite
                MsflxStuinfo.CellForeColor = vbBlack
            Next intCol
        End If
    Next intRow
    MsflxStuinfo.Row = TmpRow
    Exit Sub
Err:

        MsgBox "错误描述:" & Err.Description & vbCrLf & "错误代码:" & Err.Number, vbCritical + vbOKOnly, "未知错误"
    
End Sub

Private Sub cmdLast_Click()
    MsflxStuinfo.Row = MsflxStuinfo.Rows - 1
    DisplayInfo
End Sub

Private Sub cmdNext_Click()
    If MsflxStuinfo.Row < MsflxStuinfo.Rows - 1 Then
        MsflxStuinfo.Row = MsflxStuinfo.Row + 1
        DisplayInfo
    End If
End Sub

Private Sub cmdPrevious_Click()
    If MsflxStuinfo.Row > 2 Then
        MsflxStuinfo.Row = MsflxStuinfo.Row - 1
        DisplayInfo
    End If
End Sub

Private Sub cmdFirst_Click()
    MsflxStuinfo.Row = 2
    DisplayInfo
End Sub

Private Sub MSFlxStuInfo_Click()
    Call DisplayInfo
End Sub

⌨️ 快捷键说明

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