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

📄 课程统计.frm

📁 用vb实现学生管理系统
💻 FRM
字号:
VERSION 5.00
Begin VB.Form Frm_CountGrean 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "课程统计分析"
   ClientHeight    =   2205
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   7230
   Icon            =   "课程统计.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   2205
   ScaleWidth      =   7230
   StartUpPosition =   2  '屏幕中心
   Visible         =   0   'False
   Begin VB.CommandButton Command2 
      Caption         =   "退出"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Left            =   4320
      TabIndex        =   7
      Top             =   1560
      Width           =   1215
   End
   Begin VB.CommandButton Command1 
      Caption         =   "统计打印"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Left            =   1920
      TabIndex        =   6
      Top             =   1560
      Width           =   1215
   End
   Begin VB.TextBox Text3 
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   1680
      TabIndex        =   5
      Text            =   "Text3"
      Top             =   960
      Width           =   2295
   End
   Begin VB.CheckBox Check4 
      Caption         =   "课程名称:"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   240
      TabIndex        =   4
      Top             =   960
      Width           =   1455
   End
   Begin VB.ComboBox Combo1 
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   360
      Left            =   5760
      TabIndex        =   3
      Text            =   "Combo1"
      Top             =   360
      Width           =   1095
   End
   Begin VB.CheckBox Check2 
      Caption         =   "课程性质:"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   4440
      TabIndex        =   2
      Top             =   360
      Width           =   1575
   End
   Begin VB.TextBox Text1 
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   1200
      TabIndex        =   1
      Text            =   "Text1"
      Top             =   360
      Width           =   2295
   End
   Begin VB.CheckBox Check1 
      Caption         =   "专业:"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   240
      TabIndex        =   0
      Top             =   360
      Width           =   975
   End
End
Attribute VB_Name = "Frm_CountGrean"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False

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 Not IsNull(Text1) Then
    SQLadd = SQLadd + "and 专业='" + Text1 + "'"
End If
  
If Check2.Value = 1 And Not IsNull(Combo1) Then
    SQLadd = SQLadd + "and 课程性质='" + Combo1 + "'"
End If

'If Check3.Value = 1 And Not IsNumeric(Text2) Then
    'SQLadd = SQLadd + "and 课时='" + Text2 + "'"
'End If

If Check4.Value = 1 And Not IsNull(Text3) Then
    SQLadd = SQLadd + "and 课程名称='" + Text3 + "'"
End If

strSql = SQLoriginal + SQLadd + SQLorde
If Dat_Main.rsDat_Grean.State = 1 Then
    Dat_Main.rsDat_Grean.Close
End If
Dat_Main.rsDat_Grean.Open strSql
Dat_Grean.Show vbModal
Text1.Text = ""
Combo1.Text = ""
'Text2.Text = ""
Text3.Text = ""
End Sub

Private Sub Command2_Click()
    Unload Me
End Sub

Private Sub Form_Load()
Text1.Text = ""
'Text2.Text = ""
Text3.Text = ""
Combo1.Text = ""
Combo1.AddItem ("必修")
Combo1.AddItem ("选修")
Combo1.AddItem ("自开")
End Sub

⌨️ 快捷键说明

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