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

📄 frmresultquery.frm

📁 员工培训系统
💻 FRM
字号:
VERSION 5.00
Object = "{CE671F01-259E-40DA-92FE-95803E2ECBB5}#1.0#0"; "SmartXPButton.ocx"
Object = "{0ECD9B60-23AA-11D0-B351-00A0C9055D8E}#6.0#0"; "MSHFLXGD.OCX"
Begin VB.Form FrmResultQuery 
   BackColor       =   &H00E7DFE7&
   BorderStyle     =   1  'Fixed Single
   Caption         =   "成绩信息查询"
   ClientHeight    =   5355
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   11460
   Icon            =   "FrmResultQuery.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MDIChild        =   -1  'True
   MinButton       =   0   'False
   ScaleHeight     =   5355
   ScaleWidth      =   11460
   Begin VB.Frame Frame1 
      BackColor       =   &H00E7DFE7&
      Caption         =   "查询条件"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00000000&
      Height          =   1980
      Left            =   120
      TabIndex        =   8
      Top             =   3240
      Width           =   11160
      Begin VB.TextBox txtExamNo 
         Height          =   400
         Left            =   4680
         TabIndex        =   1
         Top             =   360
         Width           =   1935
      End
      Begin VB.ComboBox cboCourseName 
         Height          =   300
         Left            =   4680
         TabIndex        =   4
         Top             =   1275
         Width           =   2415
      End
      Begin VB.ComboBox cboResult 
         Height          =   300
         ItemData        =   "FrmResultQuery.frx":2CFA
         Left            =   7920
         List            =   "FrmResultQuery.frx":2CFC
         Style           =   2  'Dropdown List
         TabIndex        =   3
         Top             =   360
         Width           =   1335
      End
      Begin VB.TextBox txtStudentId 
         Height          =   400
         Left            =   840
         TabIndex        =   0
         Top             =   600
         Width           =   1815
      End
      Begin VB.TextBox txtStudentName 
         Height          =   400
         Left            =   840
         TabIndex        =   2
         Top             =   1230
         Width           =   1815
      End
      Begin SmartXPButton.XpButton CmdQuery 
         Height          =   495
         Left            =   9600
         TabIndex        =   5
         Top             =   360
         Width           =   1335
         _ExtentX        =   2355
         _ExtentY        =   873
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "宋体"
            Size            =   9
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Caption         =   "查找(&F)"
         CaptionMouseOverColor=   16711680
         PictureBackColor=   15790320
         PictureSmoothBackColor=   15790320
         ButtonPicture   =   "FrmResultQuery.frx":2CFE
      End
      Begin SmartXPButton.XpButton cmdExit 
         Height          =   495
         Left            =   9600
         TabIndex        =   6
         Top             =   1080
         Width           =   1335
         _ExtentX        =   2355
         _ExtentY        =   873
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "宋体"
            Size            =   9
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Caption         =   "关闭(&E)"
         CaptionMouseOverColor=   16711680
         PictureBackColor=   15790320
         PictureSmoothBackColor=   15790320
         ButtonPicture   =   "FrmResultQuery.frx":50E0
      End
      Begin SmartXPButton.XpButton cmdReturn 
         Height          =   495
         Left            =   7920
         TabIndex        =   14
         Top             =   1080
         Width           =   1335
         _ExtentX        =   2355
         _ExtentY        =   873
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "宋体"
            Size            =   9
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         CaptionAreaPercent=   100
         Caption         =   "返回(&B)"
         CaptionMouseOverColor=   16711680
         PictureSmoothBackColor=   14410727
      End
      Begin VB.Label Label6 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "分数:"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   10.5
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   210
         Left            =   7200
         TabIndex        =   13
         Top             =   480
         Width           =   525
      End
      Begin VB.Label Label5 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "姓名:"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   10.5
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   210
         Left            =   240
         TabIndex        =   12
         Top             =   1320
         Width           =   525
      End
      Begin VB.Label Label4 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "课程名称:"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   10.5
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   210
         Left            =   3360
         TabIndex        =   11
         Top             =   1320
         Width           =   945
      End
      Begin VB.Label Label3 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "员工号:"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   10.5
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   210
         Left            =   0
         TabIndex        =   10
         Top             =   720
         Width           =   735
      End
      Begin VB.Label Label1 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "考试编号:"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   10.5
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   210
         Left            =   3360
         TabIndex        =   9
         Top             =   480
         Width           =   945
      End
   End
   Begin MSHierarchicalFlexGridLib.MSHFlexGrid ResultGrid 
      Height          =   2775
      Left            =   120
      TabIndex        =   7
      Top             =   120
      Width           =   11175
      _ExtentX        =   19711
      _ExtentY        =   4895
      _Version        =   393216
      BackColorFixed  =   15196135
      BackColorBkg    =   15196135
      BackColorUnpopulated=   15196135
      _NumberOfBands  =   1
      _Band(0).Cols   =   2
   End
End
Attribute VB_Name = "FrmResultQuery"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim ResultQuery As OpenRs
Dim sql As String
Dim sql1 As String
Dim sql2 As String
Dim sql3 As String
Dim sql4 As String
Dim sql5 As String


Private Sub cboClassno_KeyPress(KeyAscii As Integer)
KeyAscii = Asc(UCase(Chr(KeyAscii)))
If Not ((Chr(KeyAscii) <= "Z" And Chr(KeyAscii) >= "A") Or (Chr(KeyAscii) <= "9" And Chr(KeyAscii) >= "0") Or KeyAscii = 8) Then
    KeyAscii = 0
End If
End Sub

Private Sub cboCourseName_KeyPress(KeyAscii As Integer)
If KeyAscii = 39 Then KeyAscii = 0
End Sub

Private Sub cmdExit_Click()
Unload Me
End Sub

Private Sub CmdQuery_Click()
On Error Resume Next
sql = "select student_info.student_id,student_info.student_name,result_info.course_no,result_info.course_name,result_info.exam_no,result_info.result from  result_info inner join  student_info on result_info.student_id=result_info.student_id inner join  course_info on result_info.course_no=course_info.course_no where 1=1"
If txtStudentId.Text <> "" Then
    sql1 = "and student_info.student_id='" & txtStudentId.Text & "'"
Else
    sql1 = " "
End If

If txtstudentName.Text <> "" Then
    sql2 = "and student_info.student_name='" & txtstudentName.Text & "'"
Else
    sql2 = " "
End If


If cboResult.Text <> "" Then
    sql3 = "and result_info.result" & cboResult.Text & ""
Else
    sql3 = " "
End If

If txtExamNo.Text <> "" Then
    sql4 = "and result_info.exam_no='" & txtExamNo.Text & "'"
Else
    sql4 = " "
End If

If cboCourseName.Text <> "" Then
    sql5 = "and result_info.course_name='" & cboCourseName.Text & "'"
Else
    sql5 = " "
End If
sql = sql & sql1 & sql2 & sql3 & sql4 & sql5
ResultQuery.rsDK1 sql
If ResultQuery.rs1.EOF Then
    ResultGrid.Clear
    ResultGrid.FormatString = " | 员 工 号|姓     名| 课 程 编 号|课 程 名 称| 考试编号|分 数"
    MsgBox "没有找到符合条件的记录!", vbOKOnly + vbInformation, "提示"
Else
ResultQuery.rsDK1 sql
    Set ResultGrid.DataSource = ResultQuery.rs1
    ResultGrid.FormatString = " | 员 工 号|姓     名| 课 程 编 号|课 程 名 称| 考试编号|分 数"
End If
End Sub

Private Sub Form_Load()
On Error Resume Next
Set ResultQuery = New OpenRs
ResultGrid.FormatString = " | 员 工 号|姓     名| 课 程 编 号|课 程 名 称| 考试编号|分 数"
ResultQuery.rsDK1 "select student_info.student_id,student_info.student_name,result_info.course_no,result_info.course_name,result_info.exam_no,result_info.result from  result_info inner join  student_info on result_info.student_id=result_info.student_id inner join  course_info on result_info.course_no=course_info.course_no where 1=1"
    ResultGrid.Clear
    Set ResultGrid.DataSource = ResultQuery.rs1
    ResultGrid.FormatString = " | 员 工 号|姓     名| 课 程 编 号|课 程 名 称| 考试编号|分 数"

ResultQuery.rsDK1 "select distinct course_name from course_info"
While Not ResultQuery.rs1.EOF
    cboCourseName.AddItem ResultQuery.rs1!course_name
    ResultQuery.rs1.MoveNext
Wend

cboResult.AddItem ">=90"
cboResult.AddItem ">=80"
cboResult.AddItem ">=70"
cboResult.AddItem ">=60"
cboResult.AddItem "<60"
cboResult.AddItem ""
End Sub

Private Sub txtExamNo_KeyPress(KeyAscii As Integer)
If Not ((UCase(Chr(KeyAscii)) <= "Z" And UCase(Chr(KeyAscii)) >= "A") Or (Chr(KeyAscii) <= "9" And Chr(KeyAscii) >= "0") Or KeyAscii = 8) Then
    KeyAscii = 0
End If
End Sub

Private Sub txtStudentId_KeyPress(KeyAscii As Integer)
KeyAscii = Asc(UCase(Chr(KeyAscii)))
If Not ((Chr(KeyAscii) <= "Z" And Chr(KeyAscii) >= "A") Or (Chr(KeyAscii) <= "9" And Chr(KeyAscii) >= "0") Or KeyAscii = 8) Then
    KeyAscii = 0
End If
End Sub

Private Sub txtstudentName_KeyPress(KeyAscii As Integer)
If KeyAscii = 39 Then KeyAscii = 0
End Sub

Private Sub cmdReturn_Click()
On Error Resume Next
ResultQuery.rsDK1 "select student_info.student_id,student_info.student_name,result_info.course_no,result_info.course_name,result_info.exam_no,result_info.result from  result_info inner join  student_info on result_info.student_id=result_info.student_id inner join  course_info on result_info.course_no=course_info.course_no where 1=1"

    Set ResultGrid.DataSource = ResultQuery.rs1
    ResultGrid.FormatString = " | 员 工 号|姓     名| 课 程 编 号|课 程 名 称| 考试编号|分 数"
cboResult.Text = ""
txtStudentId.Text = ""
txtstudentName.Text = ""
txtExamNo.Text = ""
cboCourseName.Text = ""
End Sub

⌨️ 快捷键说明

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