📄 form1.frm
字号:
VERSION 5.00
Begin VB.Form Form1
Caption = "Form1"
ClientHeight = 3150
ClientLeft = 60
ClientTop = 390
ClientWidth = 4680
LinkTopic = "Form1"
ScaleHeight = 3150
ScaleWidth = 4680
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command2
Caption = "查找姓李的同学"
Height = 345
Left = 300
TabIndex = 11
Top = 2400
Width = 3450
End
Begin VB.CommandButton Command1
Caption = "查找""学号""字段为""030101005""的记录"
Height = 375
Left = 270
TabIndex = 10
Top = 1890
Width = 3420
End
Begin VB.Data Data1
Caption = "Data1"
Connect = "Access"
DatabaseName = "F:\水利水电\教材用学生管理系统\Stud05.mdb"
DefaultCursorType= 0 '缺省游标
DefaultType = 2 '使用 ODBC
Exclusive = 0 'False
Height = 330
Left = 285
Options = 0
ReadOnly = 0 'False
RecordsetType = 1 'Dynaset
RecordSource = "学籍"
Top = 1950
Visible = 0 'False
Width = 2490
End
Begin VB.ComboBox Combo1
DataField = "性别"
DataSource = "Data1"
Height = 300
Left = 1110
TabIndex = 9
Top = 719
Width = 1380
End
Begin VB.TextBox Text4
DataField = "班级"
DataSource = "Data1"
Height = 330
Left = 1110
TabIndex = 8
Top = 1425
Width = 2220
End
Begin VB.TextBox Text3
DataField = "出生日期"
DataSource = "Data1"
Height = 330
Left = 1110
TabIndex = 7
Top = 1056
Width = 1380
End
Begin VB.TextBox Text2
DataField = "姓名"
DataSource = "Data1"
Height = 330
Left = 1110
TabIndex = 6
Top = 352
Width = 1380
End
Begin VB.TextBox Text1
DataField = "学号"
DataSource = "Data1"
Height = 330
Left = 1110
TabIndex = 5
Top = -15
Width = 1380
End
Begin VB.Label Label5
Caption = "班级"
Height = 375
Left = 105
TabIndex = 4
Top = 1470
Width = 825
End
Begin VB.Label Label4
Caption = "出生日期"
Height = 300
Left = 105
TabIndex = 3
Top = 1101
Width = 915
End
Begin VB.Label Label3
Caption = "性别"
Height = 285
Left = 105
TabIndex = 2
Top = 749
Width = 840
End
Begin VB.Label Label2
Caption = "姓名"
Height = 285
Left = 105
TabIndex = 1
Top = 397
Width = 930
End
Begin VB.Label Label1
Caption = "学号"
Height = 285
Left = 105
TabIndex = 0
Top = 45
Width = 1065
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub Command1_Click()
'Data1.Recordset.FindFirst "学号='030101005'"
'也可以用通配符*和?
Data1.Recordset.FindFirst "学号 like '03*05'"
'注意:测试时可以注释掉一条语句,使用其中一条即可
End Sub
Private Sub Command2_Click()
Data1.Recordset.FindFirst "姓名 like '李*'"
If Data1.Recordset.NoMatch Then
MsgBox "找不到姓李的学生"
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -