📄 form2.frm
字号:
VERSION 5.00
Begin VB.Form Form2
Caption = "班级信息"
ClientHeight = 5040
ClientLeft = 60
ClientTop = 450
ClientWidth = 3720
LinkTopic = "Form2"
ScaleHeight = 5040
ScaleWidth = 3720
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command6
Caption = ">>"
Height = 495
Left = 1800
TabIndex = 13
Top = 4200
Width = 615
End
Begin VB.CommandButton Command5
Caption = "<<"
Height = 495
Left = 600
TabIndex = 12
Top = 4200
Width = 615
End
Begin VB.Data Data1
Caption = "Data1"
Connect = "Access"
DatabaseName = "D:\db1.mdb"
DefaultCursorType= 0 '缺省游标
DefaultType = 2 '使用 ODBC
Exclusive = 0 'False
Height = 375
Left = 360
Options = 0
ReadOnly = 0 'False
RecordsetType = 1 'Dynaset
RecordSource = "classinfo"
Top = 0
Visible = 0 'False
Width = 2175
End
Begin VB.CommandButton Command4
Caption = "推出"
Height = 495
Left = 2280
TabIndex = 11
Top = 3600
Width = 615
End
Begin VB.CommandButton Command3
Caption = "删除"
Height = 495
Left = 1680
TabIndex = 10
Top = 3600
Width = 615
End
Begin VB.CommandButton Command2
Caption = "查看"
Height = 495
Left = 1080
TabIndex = 9
Top = 3600
Width = 615
End
Begin VB.CommandButton Command1
Caption = "添加"
Height = 495
Left = 480
TabIndex = 8
Top = 3600
Width = 615
End
Begin VB.ComboBox Combo1
Height = 300
Left = 1320
TabIndex = 7
Top = 1200
Width = 1695
End
Begin VB.TextBox Text3
Height = 375
Left = 1320
TabIndex = 6
Top = 2640
Width = 1575
End
Begin VB.TextBox Text2
Height = 375
Left = 1320
TabIndex = 5
Top = 1920
Width = 1575
End
Begin VB.TextBox Text1
Height = 375
Left = 1320
TabIndex = 4
Top = 480
Width = 1575
End
Begin VB.Label Label4
Caption = "班级人数"
Height = 375
Left = 240
TabIndex = 3
Top = 2640
Width = 735
End
Begin VB.Label Label3
Caption = "专业名"
Height = 375
Left = 240
TabIndex = 2
Top = 2040
Width = 615
End
Begin VB.Label Label2
Caption = "学院名"
Height = 375
Left = 240
TabIndex = 1
Top = 1320
Width = 735
End
Begin VB.Label Label1
Caption = "班级号"
Height = 255
Left = 240
TabIndex = 0
Top = 600
Width = 735
End
End
Attribute VB_Name = "Form2"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command5_Click()
Data1.Recordset.MovePrevious
If Data1.Recordset.AbsolutePosition <= 0 Then
Data1.Recordset.MoveFirst
MsgBox "已经是第一条记录!", vbExclamation, "提示信息"
End If
End Sub
Private Sub Command6_Click()
Data1.Recordset.MoveNext
If Data1.Recordset.AbsolutePosition <= 0 Then
Data1.Recordset.MoveLast
MsgBox "已经是最后一条记录!", vbExclamation, "提示信息"
End If
End Sub
Private Sub Form_Load()
Dim x(1 To 12) As String, i As Integer
x(1) = "纺织与服装学院 ":
x(2) = "材料科学与化学工程学院":
x(3) = "计算机技术与自动化学院":
x(4) = "信息与通信工程学院":
x(5) = "机械电子学院":
x(6) = "艺术设计学院":
x(7) = "管理学院":
x(8) = "经济学院":
x(9) = " 会计学院":
x(10) = "理学院":
x(11) = "社会科学系:"
x(12) = "外国语系"
For i = 1 To 12
Combo1.AddItem x(i)
Next i
Data1.DatabaseName = App.Path + "\" + "db1.mdb"
Data1.RecordSource = "classinfo"
Data1.Refresh
Data1.Recordset.AddNew
Text1 = "": Text2 = "": Text3 = ""
End Sub
Private Sub Command1_Click()
Data1.Recordset.AddNew
Text1 = "": Text2 = "": Text3 = ""
MsgBox (" 已经加入")
End Sub
Private Sub Command2_Click()
classgrid.Show
End Sub
Private Sub Command3_Click()
Dim tx As String
With Data1.Recordset
tx = "[Class]="
.FindFirst tx + "'" + Text1 + "'"
Data1.Recordset.Delete
Data1.Recordset.MoveNext
Text1 = "": Text2 = "": Text3 = "": Combo1 = ""
End With
End Sub
Private Sub Command4_Click()
On Error Resume Next
Data1.Recordset.Update
Data1.Recordset.Close
End
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -