📄 frmnewmark.frm
字号:
VERSION 5.00
Begin VB.Form frmNewMark
BorderStyle = 4 'Fixed ToolWindow
Caption = "添加成绩"
ClientHeight = 2340
ClientLeft = 45
ClientTop = 285
ClientWidth = 4680
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 2340
ScaleWidth = 4680
ShowInTaskbar = 0 'False
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command2
Caption = "取消"
Height = 405
Left = 3270
TabIndex = 13
Top = 1830
Width = 1290
End
Begin VB.CommandButton Command1
Caption = "确定"
Height = 390
Left = 1725
TabIndex = 12
Top = 1845
Width = 1215
End
Begin VB.Frame Frame1
Caption = "成绩"
Height = 1185
Left = 60
TabIndex = 3
Top = 525
Width = 4515
Begin VB.TextBox Text4
Height = 270
Left = 2955
TabIndex = 11
Top = 735
Width = 1155
End
Begin VB.TextBox Text3
Height = 270
Left = 2955
TabIndex = 10
Top = 345
Width = 1155
End
Begin VB.TextBox Text2
Height = 270
Left = 720
TabIndex = 9
Top = 735
Width = 1155
End
Begin VB.TextBox Text1
Height = 270
Left = 720
TabIndex = 8
Top = 330
Width = 1155
End
Begin VB.Label Label6
AutoSize = -1 'True
Caption = "计算机:"
Height = 180
Left = 2250
TabIndex = 7
Top = 735
Width = 720
End
Begin VB.Label Label5
AutoSize = -1 'True
Caption = "英语:"
Height = 180
Left = 2430
TabIndex = 6
Top = 360
Width = 540
End
Begin VB.Label Label4
AutoSize = -1 'True
Caption = "语文:"
Height = 180
Left = 195
TabIndex = 5
Top = 735
Width = 540
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "数学:"
Height = 180
Left = 195
TabIndex = 4
Top = 360
Width = 540
End
End
Begin VB.ComboBox Combo1
Height = 300
ItemData = "frmNewMark.frx":0000
Left = 795
List = "frmNewMark.frx":0002
TabIndex = 1
Text = "Combo1"
Top = 120
Width = 1740
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "学号:"
Height = 180
Left = 2745
TabIndex = 2
Top = 195
Width = 540
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "添加到:"
Height = 180
Left = 60
TabIndex = 0
Top = 180
Width = 720
End
End
Attribute VB_Name = "frmNewMark"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub Combo1_Click()
Label2.Caption = "学号:" & Split(Combo1.Text, "|")(0)
End Sub
Private Sub Command1_Click()
Dim rec As New ADODB.Recordset
rec.Open "select * from [tblMarks] where ID=" & Combo1.ItemData(Combo1.ListIndex), Con, 1, 3
If Not rec.EOF Then
MsgBox " 表中已存在此学生的成绩信息!"
Exit Sub
End If
rec.AddNew
rec("ID") = Combo1.ItemData(Combo1.ListIndex)
rec("Math") = Text1
rec("Chinese") = Text2
rec("English") = Text3
rec("IT") = Text4
rec.Update
End Sub
Private Sub Form_Load()
Dim rec As New ADODB.Recordset
rec.Open "select ID,Name,Number from [tblInfos] ORDER BY Name", Con
Combo1.Clear
Do While Not rec.EOF And Not rec.BOF
Combo1.AddItem rec("number") & "|" & rec("Name")
Combo1.ItemData(Combo1.NewIndex) = rec("ID")
rec.MoveNext
Loop
rec.Close
Set rec = Nothing
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -