📄 form7.frm
字号:
VERSION 5.00
Begin VB.Form Form7
Caption = "查找窗体"
ClientHeight = 5220
ClientLeft = 2160
ClientTop = 1395
ClientWidth = 6840
LinkTopic = "Form7"
ScaleHeight = 5220
ScaleWidth = 6840
Begin VB.Data Data1
Caption = "Data1"
Connect = "Access"
DatabaseName = ""
DefaultCursorType= 0 '缺省游标
DefaultType = 2 '使用 ODBC
Exclusive = 0 'False
Height = 495
Left = 1320
Options = 0
ReadOnly = 0 'False
RecordsetType = 1 'Dynaset
RecordSource = ""
Top = 4560
Visible = 0 'False
Width = 4215
End
Begin VB.CommandButton Command2
Caption = "取消"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 855
Left = 4920
TabIndex = 11
Top = 3240
Width = 975
End
Begin VB.CommandButton Command1
Caption = "查找"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 975
Left = 4920
TabIndex = 10
Top = 1800
Width = 975
End
Begin VB.TextBox Text5
Height = 495
Left = 1920
TabIndex = 9
Top = 3720
Width = 2295
End
Begin VB.TextBox Text4
Height = 495
Left = 1920
TabIndex = 8
Top = 3000
Width = 2295
End
Begin VB.TextBox Text3
Height = 495
Left = 1920
TabIndex = 7
Top = 2280
Width = 2295
End
Begin VB.TextBox Text2
Height = 495
Left = 1920
TabIndex = 6
Top = 1560
Width = 2295
End
Begin VB.TextBox Text1
Height = 495
Left = 1920
TabIndex = 1
Top = 480
Width = 2295
End
Begin VB.Label Label5
Caption = "任课老师"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 600
TabIndex = 5
Top = 3840
Width = 1095
End
Begin VB.Label Label4
Caption = "课程号"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 600
TabIndex = 4
Top = 3120
Width = 855
End
Begin VB.Label Label3
Caption = "院系班级"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 600
TabIndex = 3
Top = 2400
Width = 1095
End
Begin VB.Label Label2
Caption = "姓名"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 720
TabIndex = 2
Top = 1680
Width = 615
End
Begin VB.Label Label1
Caption = "请输入学号"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 480
TabIndex = 0
Top = 600
Width = 1335
End
End
Attribute VB_Name = "Form7"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
'将查找到的指定学生记录显示在文本框中
Data1.DatabaseName = App.Path & "\db1.mdb"
Data1.RecordSource = "select * from 学生信息,课程信息 where 学号=" & Text1.Text
Data1.Refresh
If Data1.Recordset.EOF Then
MsgBox ("无此学生记录")
Else
Text2.Text = Data1.Recordset.Fields("姓名")
Text3.Text = Data1.Recordset.Fields("院系班级")
Text4.Text = Data1.Recordset.Fields("课程号")
Text5.Text = Data1.Recordset.Fields("任课老师")
End If
End Sub
Private Sub Command2_Click()
Form4.Show
Unload Me
End Sub
Private Sub Form_Load()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -