?? frmfindlesn.frm
字號(hào):
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 = "課程號(hào)"
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打鉤,則只按課程號(hào)尋找
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 = "課程號(hào) 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("課程號(hào)"))
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
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -