📄 form4.frm
字号:
Width = 1575
End
Begin VB.TextBox Text2
DataField = "姓名"
DataSource = "Adodc1"
Height = 375
Left = 960
TabIndex = 10
Top = 960
Width = 975
End
Begin VB.TextBox Text4
DataField = "籍贯"
DataSource = "Adodc1"
Height = 375
Left = 960
TabIndex = 9
Top = 3720
Width = 4035
End
Begin VB.TextBox Text5
DataField = "宿舍"
DataSource = "Adodc1"
Height = 375
Left = 3480
TabIndex = 8
Top = 2520
Width = 1455
End
Begin VB.TextBox Text6
DataField = "政治面貌"
DataSource = "Adodc1"
Height = 435
Left = 3480
TabIndex = 7
Top = 1680
Width = 1455
End
Begin VB.ComboBox Combo1
DataField = "性别"
DataSource = "Adodc1"
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 405
ItemData = "Form4.frx":0000
Left = 960
List = "Form4.frx":000A
TabIndex = 6
Top = 1680
Width = 855
End
Begin VB.TextBox Text7
DataField = "电话"
DataSource = "Adodc1"
Height = 375
Left = 960
TabIndex = 5
Top = 3120
Width = 2055
End
Begin VB.Label Label8
AutoSize = -1 'True
Caption = "年龄"
Height = 180
Left = 2880
TabIndex = 24
Top = 480
Width = 360
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "学号"
Height = 180
Left = 300
TabIndex = 20
Top = 480
Width = 360
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "姓名"
Height = 180
Left = 300
TabIndex = 19
Top = 1080
Width = 360
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "性别"
Height = 180
Left = 300
TabIndex = 18
Top = 1800
Width = 360
End
Begin VB.Label Label4
AutoSize = -1 'True
Caption = "出生年月"
Height = 300
Left = 120
TabIndex = 17
Top = 2520
Width = 720
End
Begin VB.Label Label5
AutoSize = -1 'True
Caption = "宿舍"
Height = 180
Left = 2760
TabIndex = 16
Top = 2640
Width = 360
End
Begin VB.Label Label6
AutoSize = -1 'True
Caption = "籍贯"
Height = 180
Left = 360
TabIndex = 15
Top = 3840
Width = 360
End
Begin VB.Label Label7
AutoSize = -1 'True
Caption = "班级"
Height = 180
Left = 2820
TabIndex = 14
Top = 1080
Width = 360
End
Begin VB.Label Label9
AutoSize = -1 'True
Caption = "政治面貌"
Height = 180
Left = 2460
TabIndex = 13
Top = 1920
Width = 720
End
Begin VB.Label Label10
AutoSize = -1 'True
Caption = "电话"
Height = 180
Left = 360
TabIndex = 12
Top = 3240
Width = 360
End
End
Begin VB.CommandButton Command3
Caption = "提交"
Height = 555
Left = 6600
TabIndex = 3
Top = 1200
Width = 1515
End
Begin VB.CommandButton Command2
Caption = "删除"
Height = 555
Left = 6600
TabIndex = 2
Top = 360
Width = 1515
End
Begin VB.CommandButton Command4
Caption = "重置"
Height = 555
Left = 6600
TabIndex = 1
Top = 2040
Width = 1515
End
Begin VB.CommandButton Command5
Caption = "退出"
Height = 555
Left = 6600
TabIndex = 0
Top = 3840
Width = 1515
End
End
Attribute VB_Name = "Form4"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Adodc1.Recordset.MovePrevious
If Adodc1.Recordset.BOF = True Then
Adodc1.Recordset.MoveFirst
End If
End Sub
Private Sub Command3_Click()
'Adodc2.RecordSource = "select * from 学生 where 学号='" & Trim(Text1.Text) & "'"
With Adodc1.Recordset
.Fields("姓名") = Trim(Text2.Text)
.Fields("学号") = Trim(Text1.Text)
.Fields("性别") = Trim(Combo1.Text)
.Fields("生日") = Trim(Text9.Text)
.Fields("电话") = Trim(Text7.Text)
.Fields("专业") = Trim(Text3.Text)
.Fields("政治面貌") = Trim(Text6.Text)
.Fields("宿舍") = Trim(Text5.Text)
.Fields("年龄") = Trim(Text8.Text)
.Fields("籍贯") = Trim(Text4.Text)
End With
Adodc1.Recordset.Update
Command1.Enabled = False
Command3.Enabled = True
Form11.Show
Me.Hide
End Sub
Private Sub Command4_Click()
Adodc1.Recordset.AddNew
Command2.Enabled = False
Command3.Enabled = True
Command4.Enabled = True
End Sub
Private Sub Command5_Click()
Form5.Show
Unload Me
End Sub
Private Sub Command2_Click()
Dim res As Integer
res = MsgBox("确实要删除此行记录吗", vbExclamation + vbYesNo + vbDefaultButton2)
If res = vbYes Then
Adodc1.Recordset.Delete
Adodc1.Recordset.MoveNext
Adodc3.Recordset.Delete
Adodc3.Recordset.MoveNext
If Adodc1.Recordset.EOF = True Then
Adodc1.Recordset.MoveLast
End If
End If
End Sub
Private Sub Command6_Click()
Adodc1.Recordset.MoveNext
If Adodc1.Recordset.EOF = True Then
Adodc1.Recordset.MoveLast
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -