📄 addscoree.frm
字号:
End
Begin VB.Label Label5
Caption = "数学"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 3240
TabIndex = 9
Top = 360
Width = 735
End
Begin VB.Label Label4
Caption = "语文"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 240
TabIndex = 8
Top = 480
Width = 495
End
End
Begin VB.Frame Frame1
Height = 1815
Left = 240
TabIndex = 0
Top = 0
Width = 8775
Begin VB.ComboBox Combo1
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00C00000&
Height = 360
Left = 1440
TabIndex = 43
Top = 360
Width = 2535
End
Begin VB.TextBox Text3
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00C00000&
Height = 495
Left = 5400
TabIndex = 6
Top = 960
Width = 2655
End
Begin VB.TextBox Text2
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00C00000&
Height = 495
Left = 1440
TabIndex = 5
Top = 960
Width = 2535
End
Begin VB.TextBox Text1
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00C00000&
Height = 495
Left = 5400
TabIndex = 2
Top = 360
Width = 2655
End
Begin VB.Label Label20
Caption = "考试时间"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 4200
TabIndex = 42
Top = 480
Width = 1095
End
Begin VB.Label Label3
Caption = "班级"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 4200
TabIndex = 4
Top = 1200
Width = 615
End
Begin VB.Label Label2
Caption = "学号"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 240
TabIndex = 3
Top = 1200
Width = 735
End
Begin VB.Label Label1
Caption = "考试类型"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 240
TabIndex = 1
Top = 480
Width = 975
End
End
End
Attribute VB_Name = "addscore"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
If Command1.Caption = "确定(&O)" Then
If Not Testtxt(Combo1.Text) Then
MsgBox "请输入考试类型!", 48, "提示"
Combo1.SetFocus
Exit Sub
End If
If Not Testtxt(Text1.Text) Then
MsgBox "请输入时间!", 48, "提示"
Text2.SetFocus
Exit Sub
End If
If Not Testtxt(Text2.Text) Then
MsgBox "请输入学号!", 48, "提示"
Text3.SetFocus
Exit Sub
End If
If Not Testtxt(Text3.Text) Then
MsgBox "请输入班级!", 48, "提示"
Text4.SetFocus
Exit Sub
End If
txtSQL = "select * from score "
Set dream = ExecuteSQL(txtSQL, Msgtext)
dream.MoveFirst
While (dream.EOF = False)
If (dream.Fields(2)) = Trim(Text2.Text) Then
MsgBox "学号已经存在!", 48, "提示"
Exit Sub
Text2.Text = ""
Text2.SetFocus
Else
dream.MoveNext
End If
'FOR用于添加成绩信息
Wend
dream.AddNew
dream.Fields(0) = Trim(Combo1.Text)
dream.Fields(1) = Trim(Text1.Text)
dream.Fields(2) = Trim(Text2.Text)
dream.Fields(3) = Trim(Text3.Text)
dream.Fields(4) = Trim(Text4.Text)
dream.Fields(5) = Trim(Text5.Text)
dream.Fields(6) = Trim(Text6.Text)
dream.Fields(7) = Trim(Text7.Text)
dream.Fields(8) = Trim(Text8.Text)
dream.Fields(9) = Trim(Text9.Text)
dream.Fields(10) = Trim(Text10.Text)
dream.Fields(11) = Trim(Text11.Text)
dream.Fields(12) = Trim(Text12.Text)
dream.Fields(13) = Trim(Text13.Text)
dream.Fields(14) = Trim(Text14.Text)
dream.Fields(15) = Trim(Text15.Text)
dream.Fields(16) = Trim(Text16.Text)
dream.Fields(17) = Trim(Text17.Text)
dream.Fields(18) = Trim(Text18.Text)
'For i = 0 To 14
'dream.Fields(i) = Trim(Text1(i + 1).Text)
'Next i
dream.UpdateBatch
MsgBox "添加学生成绩成功!", 48, "提示"
Command1.Enabled = True
Command2.Enabled = True
Command3.Enabled = True
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
Text8.Text = ""
Text9.Text = ""
Text10.Text = ""
Text11.Text = ""
Text12.Text = ""
Text13.Text = ""
Text14.Text = ""
Text15.Text = ""
'For i = 1 To 15
' Text1(i).Text = ""
'Next i
Else
'clean text
'For i = 1 To 15
' Text1(i).Text = ""
'Next i
End If
End Sub
Private Sub Command3_Click()
Unload Me
End Sub
Private Sub Command4_Click()
Calendar1.Visible = True
End Sub
Private Sub Calendar1_Click()
Text1.Text = Calendar1.Value
Calendar1.Visible = False
End Sub
Private Sub Form_Load()
Calendar1.Visible = False
Combo1.AddItem "期中考试"
Combo1.AddItem "期末考试"
Combo1.AddItem "统考"
Combo1.AddItem "会考"
Combo1.AddItem "测试"
addscore.Height = 6690
addscore.Width = 10980
End Sub
Private Sub Label1_Click()
End Sub
Private Sub Text17_GotFocus()
Text17.Text = Val(Trim(Text4.Text)) + Val(Trim(Text5.Text)) + Val(Trim(Text6.Text)) + Val(Trim(Text7.Text)) + Val(Trim(Text8.Text)) + Val(Trim(Text8.Text)) + Val(Trim(Text9.Text)) + Val(Trim(Text10.Text)) + Val(Trim(Text11.Text)) + Val(Trim(Text12.Text)) + Val(Trim(Text13.Text)) + Val(Trim(Text14.Text)) + Val(Trim(Text15.Text))
'Text18.Text = Avg(Val(Trim(Text4.Text)), Val(Trim(Text5.Text)), Val(Trim(Text6.Text)), Val(Trim(Text7.Text)), Val(Trim(Text8.Text)), Val(Trim(Text8.Text)), Val(Trim(Text9.Text)), Val(Trim(Text10.Text)), Val(Trim(Text11.Text)), Val(Trim(Text12.Text)), Val(Trim(Text13.Text)), Val(Trim(Text14.Text)), Val(Trim(Text15.Text)))
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -