📄 frmfindlesn.frm
字号:
VERSION 5.00
Begin VB.Form frmFindLesn
Caption = "查找"
ClientHeight = 2265
ClientLeft = 6090
ClientTop = 3630
ClientWidth = 4005
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Icon = "frmFindLesn.frx":0000
LinkTopic = "Form1"
LockControls = -1 'True
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 2265
ScaleWidth = 4005
Begin VB.CommandButton cmdCancel
Caption = "取 消"
Height = 375
Left = 2880
TabIndex = 4
Top = 1850
Width = 975
End
Begin VB.CommandButton cmdFind
Caption = "查 找"
Height = 375
Left = 1920
TabIndex = 3
Top = 1850
Width = 975
End
Begin VB.Frame fraFind
Caption = "查找"
Height = 1575
Left = 120
TabIndex = 0
Top = 120
Width = 3735
Begin VB.TextBox txtFindNum
Height = 390
Left = 1560
TabIndex = 1
Top = 270
Width = 1815
End
Begin VB.TextBox txtFindName
Height = 375
Left = 1560
TabIndex = 2
Top = 960
Width = 1815
End
Begin VB.CheckBox chkOnlyNum
Caption = "Check1"
Height = 255
Left = 240
TabIndex = 5
Top = 360
Width = 255
End
Begin VB.Label labFindName
Caption = "课程名称"
Height = 255
Left = 720
TabIndex = 7
Top = 1080
Width = 855
End
Begin VB.Label labFindNum
Caption = "课程号"
Height = 255
Left = 720
TabIndex = 6
Top = 390
Width = 615
End
End
End
Attribute VB_Name = "frmFindLesn"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub cmdFind_Click()
If (chkOnlyNum = 0 And (Trim(txtFindNum.Text) <> "" Or Trim(txtFindName.Text) <> "")) Or (chkOnlyNum = 1 And Trim(txtFindNum.Text) <> "") Then
Call FindLesnIfm
Unload Me
End If
End Sub
Private Sub cmdCancel_Click()
Unload Me
End Sub
'查找课程记录,如果checkbox打钩,则只按课程号寻找
Private Sub FindLesnIfm()
On Error GoTo mErr
Dim mRst As New ADODB.Recordset
Dim mLItem As ListItem
Dim mStr As String
frmLesnIfm.lsvLesnIfm.ListItems.Clear
mStr = "课程号 LIKE '%" & Trim(txtFindNum.Text) & "%'"
If chkOnlyNum = 0 And Trim(txtFindName.Text) <> "" Then
mStr = mStr & " AND 课程名称 LIKE '%" & Trim(txtFindName.Text) & "%'"
End If
mRst.Open "SELECT * FROM tblLesson WHERE " & mStr, mCnnString, adOpenKeyset, adLockPessimistic, adCmdText
Do Until mRst.EOF
Set mLItem = frmLesnIfm.lsvLesnIfm.ListItems.Add(, , mRst("课程号"))
With mLItem
.SubItems(1) = mRst("课程名称")
.SubItems(2) = mRst("教材名称")
.SubItems(3) = mRst("任课老师")
.Tag = mRst("课程ID")
End With
mRst.MoveNext
Loop
mRst.Close
Set mRst = Nothing
Exit Sub
mErr:
MsgBox Err.Number & "," & Err.Description, vbCritical + vbOKOnly, mTitle
End
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -