form1.frm
来自「利用VB和ACCESS开发的一个学生管理系统适用于初学者参考」· FRM 代码 · 共 98 行
FRM
98 行
VERSION 5.00
Begin VB.Form Form1
Caption = "Form1"
ClientHeight = 4980
ClientLeft = 60
ClientTop = 345
ClientWidth = 6975
LinkTopic = "Form1"
ScaleHeight = 4980
ScaleWidth = 6975
StartUpPosition = 3 '窗口缺省
Begin VB.TextBox Text1
Height = 270
Index = 5
Left = 3600
TabIndex = 5
Top = 1800
Width = 855
End
Begin VB.TextBox Text1
Height = 270
Index = 4
Left = 1440
TabIndex = 4
Top = 1800
Width = 855
End
Begin VB.TextBox Text1
Height = 270
Index = 3
Left = 3600
TabIndex = 3
Top = 1440
Width = 855
End
Begin VB.TextBox Text1
Height = 270
Index = 2
Left = 1560
TabIndex = 2
Top = 1320
Width = 855
End
Begin VB.TextBox Text1
Height = 270
Index = 1
Left = 3480
TabIndex = 1
Top = 720
Width = 855
End
Begin VB.TextBox Text1
Height = 270
Index = 0
Left = 1560
TabIndex = 0
Top = 720
Width = 855
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Text1_Change(Index As Integer)
Dim findStr As String
Dim cnn2 As New ADODB.Connection
Dim rsSearch As New ADODB.Recordset
' If Text1(0).Text = Empty Then
' MsgBox "Cannot be Left Empty"
' txtFind.SetFocus
' Exit Sub
' End If
findStr = "select * from Admission where sid='" & Text1(0).Text & "'"
cnn2.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\SAdmin.mdb;Persist Security Info=False"
cnn2.Open
rsSearch.Open findStr, cnn2, adOpenDynamic
If rsSearch.EOF And rsSearch.BOF Then
Text1(1).Text = ""
Text1(2).Text = ""
Text1(3).Text = ""
Text1(4).Text = ""
Text1(5).Text = ""
Else
Text1(1).Text = rsSearch(1)
Text1(2).Text = rsSearch(2)
Text1(3).Text = rsSearch(3)
Text1(4).Text = rsSearch(4)
Text1(5).Text = rsSearch(5)
End If
cnn2.Close
End Sub
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?