📄 frmappend.frm
字号:
VERSION 5.00
Begin VB.Form frmAppend
BorderStyle = 3 'Fixed Dialog
Caption = "添加"
ClientHeight = 2925
ClientLeft = 45
ClientTop = 330
ClientWidth = 3585
Icon = "frmAppend.frx":0000
LinkTopic = "Form2"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 2925
ScaleWidth = 3585
ShowInTaskbar = 0 'False
StartUpPosition = 1 '所有者中心
Begin VB.CommandButton Command2
Caption = "取消"
Height = 375
Left = 2040
TabIndex = 9
Top = 2280
Width = 1215
End
Begin VB.CommandButton Command1
Caption = "确定"
Height = 375
Left = 360
TabIndex = 8
Top = 2280
Width = 1215
End
Begin VB.ComboBox comYear
Height = 300
Left = 960
Style = 2 'Dropdown List
TabIndex = 7
Top = 1560
Width = 1335
End
Begin VB.ComboBox comMajor
Height = 300
Left = 960
Style = 2 'Dropdown List
TabIndex = 5
Top = 1080
Width = 1815
End
Begin VB.ComboBox comSchool
Height = 300
Left = 960
Style = 2 'Dropdown List
TabIndex = 3
Top = 600
Width = 1815
End
Begin VB.TextBox txtName
Height = 270
Left = 960
TabIndex = 1
Top = 240
Width = 975
End
Begin VB.Label Label4
Caption = "年级"
Height = 255
Left = 360
TabIndex = 6
Top = 1680
Width = 495
End
Begin VB.Label Label3
Caption = "专业"
Height = 255
Left = 360
TabIndex = 4
Top = 1200
Width = 495
End
Begin VB.Label Label2
Caption = "院系"
Height = 255
Left = 360
TabIndex = 2
Top = 720
Width = 495
End
Begin VB.Label Label1
Caption = "姓名"
Height = 255
Left = 360
TabIndex = 0
Top = 240
Width = 495
End
End
Attribute VB_Name = "frmAppend"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub Command1_Click()
Dim i As Integer
frmMain.Grid.Rows = frmMain.Grid.Rows + 1
i = frmMain.Grid.Rows - 1
frmMain.Grid.TextMatrix(i, 1) = txtName
frmMain.Grid.TextMatrix(i, 2) = comSchool.Text
frmMain.Grid.TextMatrix(i, 3) = comMajor.Text
frmMain.Grid.TextMatrix(i, 4) = comYear.Text
frmMain.Grid.TextMatrix(i, 0) = i
frmMain.Grid.TextMatrix(i, 5) = 0
frmMain.Grid.TextMatrix(i, 6) = 0
frmMain.Grid.TextMatrix(i, 7) = 0
frmMain.Grid.TextMatrix(i, 8) = 0
recset.AddNew
recset!姓名 = txtName
recset!院系 = comSchool.ListIndex + 1
recset!专业 = GetMajorNum(comMajor.Text, recset!院系)
recset!年级 = comYear.Text
recset.Update
Unload Me
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub comSchool_click()
comMajor.Clear
recmajor.MoveFirst
Do While Not recmajor.EOF
If recmajor!院系 = comSchool.ListIndex + 1 Then
comMajor.AddItem recmajor!名称
End If
recmajor.MoveNext
Loop
End Sub
Private Sub Form_Load()
Dim i As Integer
recschool.MoveFirst
Do While Not recschool.EOF
comSchool.AddItem recschool!名称
recschool.MoveNext
Loop
For i = 1 To 20
comYear.AddItem i + 2000
Next
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -