📄 frmjiaoshi.frm
字号:
List = "frmjiaoshi.frx":01A3
TabIndex = 4
Top = 1020
Width = 1095
End
Begin VB.ComboBox Combo3
Height = 300
Index = 0
ItemData = "frmjiaoshi.frx":01CE
Left = 960
List = "frmjiaoshi.frx":01DE
TabIndex = 3
Top = 1020
Width = 1095
End
Begin VB.TextBox Text1
Enabled = 0 'False
Height = 375
Left = 3720
TabIndex = 2
Top = 240
Width = 1815
End
Begin VB.ComboBox Combo1
Height = 300
Left = 960
TabIndex = 1
Text = "选择"
Top = 300
Width = 1215
End
Begin VB.Label Label11
AutoSize = -1 'True
Caption = "学期结束"
Height = 180
Left = 4560
TabIndex = 15
Top = 1620
Width = 720
End
Begin VB.Label Label10
AutoSize = -1 'True
Caption = "学期开始"
Height = 180
Left = 4560
TabIndex = 14
Top = 1080
Width = 720
End
Begin VB.Label Label9
AutoSize = -1 'True
Caption = "月"
Height = 180
Index = 1
Left = 3960
TabIndex = 13
Top = 1620
Width = 180
End
Begin VB.Label Label8
AutoSize = -1 'True
Caption = "年"
Height = 180
Index = 1
Left = 2265
TabIndex = 12
Top = 1620
Width = 180
End
Begin VB.Label Label9
AutoSize = -1 'True
Caption = "月"
Height = 180
Index = 0
Left = 3960
TabIndex = 11
Top = 1080
Width = 180
End
Begin VB.Label Label8
AutoSize = -1 'True
Caption = "年"
Height = 180
Index = 0
Left = 2265
TabIndex = 10
Top = 1080
Width = 180
End
Begin VB.Label Label7
AutoSize = -1 'True
Caption = "学期"
Height = 180
Left = 360
TabIndex = 9
Top = 1080
Width = 360
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "班主任姓名"
Height = 180
Left = 2520
TabIndex = 8
Top = 360
Width = 900
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "班级"
Height = 180
Left = 360
TabIndex = 7
Top = 360
Width = 360
End
End
End
Attribute VB_Name = "frmjiaoshi"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Form_Load()
Me.Height = 6570
Me.Width = 6165
Dim mrccc As ADODB.Recordset
Dim msgtext As String
Dim txtSQL As String
' Combo1.Clear
txtSQL = "select id from class"
Set mrccc = ExecuteSQL(txtSQL, msgtext)
Do While Not mrccc.EOF
Combo1.AddItem mrccc.Fields(0)
mrccc.MoveNext
Loop
mrccc.Close
End Sub
Private Sub Combo1_Click()
Dim mrccc As ADODB.Recordset
Dim msgtext As String
Dim txtSQL As String
Dim aa As String
txtSQL = "select name1 from teacher where class='" & Combo1 & "' "
Set mrccc = ExecuteSQL(txtSQL, msgtext)
If Not mrccc.EOF Then
Text1.Text = mrccc.Fields(0)
Else: MsgBox "该班级没有班主任,检查数据库设置"
End If
End Sub
Private Sub Command1_Click()
Dim intcount As Integer
Dim smg, smg1, zong As String
Dim mr As ADODB.Recordset
Dim msgtext As String
If Trim(Combo1 & "") = "选择" Then
MsgBox "请选择班级", vbOKOnly + vbExclamation, "警告"
Exit Sub
End If
If Trim(Combo3(0) & "") = "" Then
MsgBox "请选择年份", vbOKOnly + vbExclamation, "警告"
Exit Sub
End If
If Trim(Combo4(0) & "") = "" Then
MsgBox "请选择月份", vbOKOnly + vbExclamation, "警告"
Exit Sub
End If
If Trim(Combo3(1) & "") = "" Then
MsgBox "请选择年份", vbOKOnly + vbExclamation, "警告"
Exit Sub
End If
If Trim(Combo4(1) & "") = "" Then
MsgBox "请选择月份", vbOKOnly + vbExclamation, "警告"
Exit Sub
End If
If Trim(Combo2(0) & "") = "" Then
MsgBox "请选择测评分数", vbOKOnly + vbExclamation, "警告"
Exit Sub
End If
If Trim(Combo2(1) & "") = "" Then
MsgBox "请选择测评分数", vbOKOnly + vbExclamation, "警告"
Exit Sub
End If
If Trim(Combo2(2) & "") = "" Then
MsgBox "请选择测评分数", vbOKOnly + vbExclamation, "警告"
Exit Sub
End If
If Trim(Combo2(3) & "") = "" Then
MsgBox "请选择测评分数", vbOKOnly + vbExclamation, "警告"
Exit Sub
End If
If Trim(Combo2(4) & "") = "" Then
MsgBox "请选择测评分数", vbOKOnly + vbExclamation, "警告"
Exit Sub
End If
If Trim(Combo2(5) & "") = "" Then
MsgBox "请选择测评分数", vbOKOnly + vbExclamation, "警告"
Exit Sub
End If
If Trim(Combo2(6) & "") = "" Then
MsgBox "请选择测评分数", vbOKOnly + vbExclamation, "警告"
Exit Sub
End If
smg = Format(CDate(Combo3(0) & "-" & Combo4(0) & "-" & "1"), "yyyy-mm-dd")
smg1 = Format(CDate(Combo3(1) & "-" & Combo4(1) & "-" & "1"), "yyyy-mm-dd")
If smg1 < smg Then
MsgBox "错误!请检查学期的起止日期", vbOKOnly + vbExclamation, "警告"
Exit Sub
End If
If Trim(Text2.Text & "") = "" Then
MsgBox "请输入测评人的姓名", vbOKOnly + vbExclamation, "警告"
Exit Sub
End If
txtSQL = "delete from renkejiaoshi where 班级='" & Trim(Combo1) & "' and 学期1='" & smg & "' and 学期2='" & smg1 & "' and 测评人='" & Trim(Text2.Text) & "'"
Set mr = ExecuteSQL(txtSQL, msgtext)
txtSQL = "execute jiaoshisetup'"
txtSQL = txtSQL & Trim(Combo2(0)) & "','"
txtSQL = txtSQL & Trim(Combo2(1)) & "','"
txtSQL = txtSQL & Trim(Combo2(2)) & "','"
txtSQL = txtSQL & Trim(Combo2(3)) & "','"
txtSQL = txtSQL & Trim(Combo2(4)) & "','"
txtSQL = txtSQL & Trim(Combo2(5)) & "','"
txtSQL = txtSQL & Trim(Combo2(6)) & "','"
txtSQL = txtSQL & Trim(Text2.Text) & "','"
txtSQL = txtSQL & smg & "','"
txtSQL = txtSQL & Trim(Text1.Text) & "','"
txtSQL = txtSQL & Trim(Combo1) & "','"
txtSQL = txtSQL & smg1 & "'"
Set mr = ExecuteSQL(txtSQL, msgtext)
Unload Me
frmjiaoshi.Show
MsgBox "添加纪录成功!", vbOKOnly + vbExclamation, "添加纪录"
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -