frmcxcj.frm

来自「这是一个VB+ACCESS开发的学生信息管理系统,我是用了一个多月才弄出来的嘎,」· FRM 代码 · 共 780 行 · 第 1/2 页

FRM
780
字号
         Left            =   120
         TabIndex        =   15
         Top             =   810
         Width           =   360
      End
   End
   Begin VB.Frame Frame1 
      Caption         =   "模糊查找"
      Height          =   975
      Left            =   120
      TabIndex        =   1
      Top             =   1920
      Width           =   7575
      Begin VB.CommandButton Command5 
         Caption         =   "报表"
         Height          =   375
         Left            =   6600
         TabIndex        =   23
         Top             =   560
         Width           =   855
      End
      Begin VB.ComboBox Combo2 
         Height          =   300
         Left            =   5040
         TabIndex        =   11
         Text            =   "请选择"
         Top             =   480
         Width           =   1455
      End
      Begin VB.OptionButton Option5 
         Caption         =   "按课程"
         Height          =   255
         Left            =   5040
         TabIndex        =   10
         Top             =   240
         Width           =   975
      End
      Begin VB.CommandButton Command1 
         Caption         =   "查找"
         Height          =   375
         Left            =   6600
         TabIndex        =   9
         Top             =   120
         Width           =   855
      End
      Begin VB.ComboBox Combo1 
         Height          =   300
         Left            =   3240
         TabIndex        =   8
         Text            =   "请选择"
         Top             =   480
         Width           =   1575
      End
      Begin VB.OptionButton Option3 
         Caption         =   "按班级"
         Height          =   255
         Left            =   3240
         TabIndex        =   7
         Top             =   240
         Width           =   975
      End
      Begin VB.TextBox Text2 
         Height          =   270
         Left            =   1680
         TabIndex        =   6
         Top             =   480
         Width           =   1335
      End
      Begin VB.OptionButton Option2 
         Caption         =   "按姓名"
         Height          =   255
         Left            =   1680
         TabIndex        =   5
         Top             =   240
         Width           =   855
      End
      Begin VB.OptionButton Option1 
         Caption         =   "按学号"
         Height          =   255
         Left            =   120
         TabIndex        =   4
         Top             =   240
         Width           =   855
      End
      Begin VB.TextBox Text1 
         Height          =   270
         Left            =   120
         TabIndex        =   3
         Top             =   480
         Width           =   1335
      End
   End
   Begin MSDataGridLib.DataGrid DataGrid1 
      Height          =   1575
      Left            =   120
      TabIndex        =   0
      Top             =   120
      Width           =   7575
      _ExtentX        =   13361
      _ExtentY        =   2778
      _Version        =   393216
      HeadLines       =   1
      RowHeight       =   15
      FormatLocked    =   -1  'True
      BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "宋体"
         Size            =   9
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      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         =   "学生成绩"
      ColumnCount     =   5
      BeginProperty Column00 
         DataField       =   "学号"
         Caption         =   "学号"
         BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
            Type            =   0
            Format          =   ""
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   2052
            SubFormatType   =   0
         EndProperty
      EndProperty
      BeginProperty Column01 
         DataField       =   "姓名"
         Caption         =   "姓名"
         BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
            Type            =   0
            Format          =   ""
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   2052
            SubFormatType   =   0
         EndProperty
      EndProperty
      BeginProperty Column02 
         DataField       =   "课程名称"
         Caption         =   "课程名称"
         BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
            Type            =   0
            Format          =   ""
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   2052
            SubFormatType   =   0
         EndProperty
      EndProperty
      BeginProperty Column03 
         DataField       =   "分数"
         Caption         =   "分数"
         BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
            Type            =   0
            Format          =   ""
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   2052
            SubFormatType   =   0
         EndProperty
      EndProperty
      BeginProperty Column04 
         DataField       =   "班级名称"
         Caption         =   "班级名称"
         BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
            Type            =   0
            Format          =   ""
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   2052
            SubFormatType   =   0
         EndProperty
      EndProperty
      SplitCount      =   1
      BeginProperty Split0 
         BeginProperty Column00 
            ColumnWidth     =   1395.213
         EndProperty
         BeginProperty Column01 
            ColumnWidth     =   1275.024
         EndProperty
         BeginProperty Column02 
            ColumnWidth     =   1590.236
         EndProperty
         BeginProperty Column03 
            ColumnWidth     =   884.976
         EndProperty
         BeginProperty Column04 
            ColumnWidth     =   2085.166
         EndProperty
      EndProperty
   End
End
Attribute VB_Name = "frmcxcj"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False

Private Sub Combo3_Click()
Dim e As String
Dim f As String
Adodc4.RecordSource = " select * from 成绩 where 班级名称='" & Trim(Combo3.Text) & "'order by 姓名 "
Adodc4.Refresh
If Adodc4.Recordset.RecordCount > 0 Then
Combo5.Clear
Combo5.Text = "请选择"
f = ""
With Adodc4.Recordset
    .MoveFirst
    Do While Not .EOF
    e = .Fields(1)
    If e <> f Then
    Combo5.AddItem .Fields(1)
    End If
    f = e
    .MoveNext
    Loop
    End With
End If
End Sub

Private Sub Combo5_Click()
Adodc5.RecordSource = " select * from 成绩 where 姓名='" & Trim(Combo5.Text) & "'order by 姓名 "
Adodc5.Refresh
If Adodc5.Recordset.RecordCount > 0 Then
Text3.Text = Adodc5.Recordset.Fields(0)
End If
End Sub

Private Sub Command1_Click()
Dim cxSQL As String
If Option1 = True Then
cxSQL = "select * from 成绩 where 学号 like '%" & Trim(Text1.Text) & "%'"
ElseIf Option2 = True Then
cxSQL = "select * from 成绩 where 姓名 like '%" & Trim(Text2.Text) & "%'"
ElseIf Option3 = True Then
cxSQL = "select * from 成绩 where 班级名称 like '%" & Trim(Combo1.Text) & "%'"
ElseIf Option5 = True Then
cxSQL = "select * from 成绩 where 课程名称 like '%" & Trim(Combo2.Text) & "%'"
End If
Adodc3.RecordSource = cxSQL
Adodc3.Refresh
Set DataGrid1.DataSource = Adodc3
DataGrid1.Refresh
Command5.Enabled = True
Command4.Enabled = False
End Sub

Private Sub Command2_Click()
Adodc6.RecordSource = " select * from 成绩 where 学号 like '%" & Trim(Text3.Text) & "%' and 姓名 like '%" & Trim(Combo5.Text) & "%' and 课程名称 like '%" & Trim(Combo4.Text) & "%' and 班级名称 like '%" & Trim(Combo3.Text) & "%'"
Adodc6.Refresh
If Adodc6.Recordset.RecordCount > 0 Then
Set DataGrid1.DataSource = Adodc6
DataGrid1.Refresh
End If
Command4.Enabled = True
Command5.Enabled = False
End Sub

Private Sub Command3_Click()
Unload Me
End Sub

Private Sub Command4_Click()
With DEv1.rscmmEss
If .State = adStateOpen Then .Close
.Source = Adodc6.RecordSource
.Open
.Requery
End With
DataReport1.Show 1
End Sub

Private Sub Command5_Click()
With DEv1.rscmmEss
If .State = adStateOpen Then .Close
.Source = Adodc3.RecordSource
.Open
.Requery
End With
DataReport1.Show 1
End Sub

Private Sub Form_Load()
Dim a As String
Dim b As String
Dim c As String
Dim d As String
Adodc1.RecordSource = " select * from 成绩 order by 班级名称 "
Adodc1.Refresh
If Adodc1.Recordset.RecordCount > 0 Then
Combo1.Clear
Combo3.Clear
Combo1.Text = "请选择"
Combo3.Text = "请选择"
b = ""
With Adodc1.Recordset
    .MoveFirst
    Do While Not .EOF
    a = .Fields(4)
    If a <> b Then
    Combo1.AddItem .Fields(4)
    Combo3.AddItem .Fields(4)
    End If
    b = a
    .MoveNext
    Loop
    End With
End If
Adodc2.RecordSource = " select * from 成绩 order by 课程名称 "
Adodc2.Refresh
If Adodc2.Recordset.RecordCount > 0 Then
Combo2.Clear
Combo4.Clear
Combo2.Text = "请选择"
Combo4.Text = "请选择"
d = ""
With Adodc2.Recordset
    .MoveFirst
    Do While Not .EOF
    c = .Fields(2)
    If c <> d Then
    Combo2.AddItem .Fields(2)
    Combo4.AddItem .Fields(2)
    End If
    d = c
    .MoveNext
    Loop
    End With
End If
Option1 = True
Text2.Text = "输入姓名"
Text2.Enabled = False
Combo1.Enabled = False
Combo2.Enabled = False
Command5.Enabled = False
Command4.Enabled = False
End Sub

Private Sub Option1_Click()
Text1.Enabled = True
End Sub

Private Sub Option2_Click()
Text1.Enabled = False
Text2.Enabled = True
Combo1.Enabled = False
Combo2.Enabled = False
Call FocusBack(Text2)
End Sub

Private Sub Option3_Click()
Text1.Enabled = False
Text2.Enabled = False
Combo1.Enabled = True
Combo2.Enabled = False
Combo1.SetFocus
End Sub

Private Sub Option5_Click()
Text1.Enabled = False
Text2.Enabled = False
Combo1.Enabled = False
Combo2.Enabled = True
Combo2.SetFocus
End Sub
Private Sub Form_Initialize()
ChDrive App.Path
ChDir App.Path
End Sub


⌨️ 快捷键说明

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