📄 frmfindstu.frm
字号:
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Begin VB.Form frmFindStu
Caption = "查找"
ClientHeight = 3915
ClientLeft = 6090
ClientTop = 3630
ClientWidth = 5250
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Icon = "frmFindStu.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 3915
ScaleWidth = 5250
Begin VB.CommandButton cmdCancel
Caption = "取 消"
Height = 375
Left = 3240
TabIndex = 4
Top = 3000
Width = 975
End
Begin VB.CommandButton cmdFind
Caption = "查 找"
Height = 375
Left = 720
TabIndex = 3
Top = 3000
Width = 975
End
Begin VB.Frame fraFind
Caption = "查找"
Height = 2655
Left = 120
TabIndex = 0
Top = 120
Width = 4575
Begin MSComctlLib.ImageCombo ImageCombo2
Height = 315
Left = 1920
TabIndex = 14
Top = 2040
Width = 2295
_ExtentX = 4048
_ExtentY = 556
_Version = 393216
ForeColor = -2147483640
BackColor = -2147483643
End
Begin VB.OptionButton Option4
Caption = "Option4"
Height = 375
Left = 240
TabIndex = 12
Top = 2040
Width = 255
End
Begin VB.OptionButton Option3
Caption = "Option3"
Height = 255
Left = 240
TabIndex = 11
Top = 1560
Width = 255
End
Begin VB.OptionButton Option2
Caption = "Option2"
Height = 375
Left = 240
TabIndex = 10
Top = 960
Width = 255
End
Begin VB.OptionButton Option1
Caption = "Option1"
Height = 255
Left = 240
TabIndex = 9
Top = 480
Width = 255
End
Begin MSComctlLib.ImageCombo ImageCombo1
Height = 315
Left = 1920
TabIndex = 8
Top = 1560
Width = 2295
_ExtentX = 4048
_ExtentY = 556
_Version = 393216
ForeColor = -2147483640
BackColor = -2147483643
End
Begin VB.TextBox txtFindName
Height = 375
Left = 1920
TabIndex = 2
Top = 960
Width = 2175
End
Begin VB.TextBox txtFindNum
Height = 390
Left = 1920
TabIndex = 1
Top = 360
Width = 2175
End
Begin VB.Label Label2
Caption = "课程名称"
Height = 375
Left = 720
TabIndex = 13
Top = 2160
Width = 855
End
Begin VB.Label Label1
Caption = "班 级"
Height = 255
Left = 720
TabIndex = 7
Top = 1560
Width = 855
End
Begin VB.Label labFindNum
Caption = "学生学号"
Height = 255
Left = 720
TabIndex = 6
Top = 480
Width = 855
End
Begin VB.Label labFindName
Caption = "学生姓名"
Height = 255
Left = 720
TabIndex = 5
Top = 1080
Width = 855
End
End
End
Attribute VB_Name = "frmFindStu"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub cmdFind_Click()
If Trim(txtFindNum.Text) = "" And Trim(txtFindName.Text) = "" And ((Trim(ImageCombo1.Text) = "" Or Trim(ImageCombo1.Text) = "班级名称")) Then
MsgBox ("请重新输入!")
End If
If Trim(txtFindNum.Text) <> "" And txtFindNum.Enabled = True Then
Select Case SeltFrom
Case 1
Call FindStuIfm
Case 2
Call FindMdfiScore
Case 3
Call FindStuPlace
End Select
End If
If Trim(txtFindName.Text) <> "" And txtFindName.Enabled = True Then
Select Case SeltFrom
Case 1
Call FindStuIfm_Name
Case 2
Call FindMdfiScore_Name
Case 3
Call FindStuPlace_Name
End Select
End If
If (Trim(ImageCombo1.Text) <> "" Or Trim(ImageCombo1.Text) <> "班级名称") And ImageCombo1.Enabled = True Then
Select Case SeltFrom
Case 1
Call FindStuIfm_Class
Case 2
Call FindMdfiScore_Class
Case 3
Call FindStuPlace_Class
End Select
End If
If SeltFrom = 1 Then
'frmStuIfm.Show
'Load frmMdfiScore
'frmMdfiScore.Show
'Unload login
mCnnString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\StuScore.mdb" & ";Persist Security Info=False"
'MDIfrmMain.Show
End If
End Sub
Private Sub cmdCancel_Click()
Unload Me
End Sub
'查找学生资料记录,若checkbox打钩则只按学生学号查找
Private Sub FindStuIfm()
On Error GoTo mErr
Dim mRst As New ADODB.Recordset
Dim mLItem As ListItem
Dim mStrSend As String
frmStuIfm.lsvStuIfm.ListItems.Clear
mStrSend = ""
Call FindStr(mStrSend)
mRst.Open "SELECT * FROM tblStudent WHERE " & mStrSend, mCnnString, adOpenKeyset, adLockPessimistic, adCmdText
Do Until mRst.EOF
Set mLItem = frmStuIfm.lsvStuIfm.ListItems.Add(, , mRst("学生学号"))
With mLItem
.SubItems(1) = mRst("学生姓名")
.SubItems(2) = mRst("性别")
.SubItems(3) = Format(mRst("入学日期"), "yyyy年mm月dd日")
.Tag = mRst("学生ID")
.SubItems(4) = mRst("班级")
.SubItems(5) = mRst("院系")
End With
mRst.MoveNext
Loop
mRst.Close
Set mRst = Nothing
Exit Sub
mErr:
MsgBox Err.Number & "," & Err.Description, vbCritical + vbOKOnly, mTitle
End
End Sub
'按照学生的姓名查
Private Sub FindStuIfm_Name()
On Error GoTo mErr
Dim mRst As New ADODB.Recordset
Dim mLItem As ListItem
Dim mStrSend As String
frmStuIfm.lsvStuIfm.ListItems.Clear
mStrSend = ""
Call FindStr(mStrSend)
mRst.Open "SELECT * FROM tblStudent WHERE " & mStrSend, mCnnString, adOpenKeyset, adLockPessimistic, adCmdText
Do Until mRst.EOF
Set mLItem = frmStuIfm.lsvStuIfm.ListItems.Add(, , mRst("学生学号"))
With mLItem
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -