📄 form3.frm
字号:
VERSION 5.00
Begin VB.Form Form3
BackColor = &H00FF8080&
BorderStyle = 0 'None
Caption = "Form3"
ClientHeight = 3195
ClientLeft = 0
ClientTop = 0
ClientWidth = 4680
LinkTopic = "Form3"
ScaleHeight = 3195
ScaleWidth = 4680
ShowInTaskbar = 0 'False
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command2
BackColor = &H00C0C0FF&
Caption = "返回"
Height = 375
Left = 2040
Style = 1 'Graphical
TabIndex = 5
Top = 2280
Width = 975
End
Begin VB.CommandButton Command1
Appearance = 0 'Flat
BackColor = &H00C0C0FF&
Caption = "进入"
Enabled = 0 'False
Height = 375
Left = 3240
Style = 1 'Graphical
TabIndex = 2
Top = 2280
Width = 975
End
Begin VB.TextBox Text2
Height = 375
Left = 1560
TabIndex = 1
Top = 1440
Width = 1695
End
Begin VB.TextBox Text1
Height = 375
Left = 1560
TabIndex = 0
Text = " "
Top = 600
Width = 1695
End
Begin VB.Line Line5
X1 = 120
X2 = 4560
Y1 = 3120
Y2 = 3120
End
Begin VB.Line Line4
X1 = 4560
X2 = 4560
Y1 = 120
Y2 = 3120
End
Begin VB.Line Line3
X1 = 120
X2 = 120
Y1 = 120
Y2 = 3120
End
Begin VB.Line Line2
X1 = 120
X2 = 4560
Y1 = 240
Y2 = 240
End
Begin VB.Line Line1
X1 = 120
X2 = 4560
Y1 = 120
Y2 = 120
End
Begin VB.Label Label2
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "姓名:"
BeginProperty Font
Name = "宋体"
Size = 15
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 300
Left = 480
TabIndex = 4
Top = 1440
Width = 900
End
Begin VB.Label Label1
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "学号:"
BeginProperty Font
Name = "宋体"
Size = 15.75
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 315
Left = 480
TabIndex = 3
Top = 600
Width = 945
End
End
Attribute VB_Name = "Form3"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
xuehao = Text1.Text
Form1.Show
Me.Hide
End Sub
Private Sub Command2_Click()
Me.Hide
Form2.Show
End Sub
Private Sub Form_Load()
Move (Screen.Width - Form3.Width) / 2, (Screen.Height - Form3.Height) / 2
End Sub
Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Dim db As Database
Dim rs As Recordset
Set db = OpenDatabase(App.Path + "\stk.mdb")
Set rs = db.OpenRecordset("cj")
rs.Index = "xh"
rs.Seek "=", Text1.Text
If Not rs.NoMatch Then
Text2.Text = rs.Fields("xm")
xmm = Text2.Text
Command1.Enabled = True
Command1.SetFocus
Else: MsgBox ("数据库中无此学号")
End If
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -