📄 frmupdatescore.frm
字号:
VERSION 5.00
Begin VB.Form frmupdatescore
BackColor = &H00FFFFFF&
BorderStyle = 1 'Fixed Single
Caption = "修改学生成绩"
ClientHeight = 4785
ClientLeft = 45
ClientTop = 435
ClientWidth = 3270
ControlBox = 0 'False
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 4785
ScaleWidth = 3270
Begin VB.CommandButton CmdQuit
Cancel = -1 'True
Caption = "返回"
Height = 420
Left = 1905
TabIndex = 4
Top = 4200
Width = 1050
End
Begin VB.CommandButton CmdOK
Caption = "确认修改"
Default = -1 'True
Height = 420
Left = 240
TabIndex = 3
Top = 4200
Width = 1050
End
Begin VB.TextBox txtID
Height = 330
Left = 1785
TabIndex = 2
Top = 240
Width = 1230
End
Begin VB.ComboBox coblesson
Height = 300
Left = 1800
TabIndex = 1
Text = "coblesson"
Top = 3720
Width = 1215
End
Begin VB.ListBox List1
Height = 2760
Left = 240
TabIndex = 0
Top = 720
Width = 2775
End
Begin VB.Label Label1
BackColor = &H00FFFFFF&
Caption = "请输入学号:"
Height = 240
Left = 240
TabIndex = 6
Top = 240
Width = 1185
End
Begin VB.Label Label2
BackColor = &H00FFFFFF&
Caption = "请选择课程:"
Height = 255
Left = 240
TabIndex = 5
Top = 3735
Width = 1095
End
End
Attribute VB_Name = "frmupdatescore"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public sk2 As String
Public sk3 As String
Private Sub cmdQuit_Click()
Unload Me
End Sub
Private Sub Form_Load()
Me.Height = 5265
Me.Width = 3360
Me.Move (Screen.Width - Me.Width) / 2, (Screen.Height - Me.Height) / 2 - 800
'lesson
Set adoRS = adoCon.Execute("Select 课程名称 From Lesson Order By 课程名称")
coblesson.Clear
Do While Not adoRS.EOF
coblesson.AddItem Trim(adoRS("课程名称"))
adoRS.MoveNext
Loop
coblesson.ListIndex = 0
Me.Show
txtID.SetFocus
Set adoRS = adoCon.Execute("Select ID From Student Order By ID")
List1.Clear
Do While Not adoRS.EOF
List1.AddItem Trim(adoRS("ID"))
adoRS.MoveNext
Loop
List1.ListIndex = 0
End Sub
Private Sub CmdOK_Click()
Dim sCon As String
If txtID.Text = "" Then
txtID.Text = "请输学号"
txtID.SelStart = 0
txtID.SelLength = Len(txtID.Text)
txtID.SetFocus
Exit Sub
End If
sCon = "select * from score where 学号='" & txtID.Text & "' and 课程='" & coblesson.Text & "'"
Set adoRS = adoCon.Execute(sCon)
If adoRS.EOF Then
MsgBox "对不起,查无此学生的" & Trim(coblesson.Text) & "成绩,请执行系统查询功能," _
& vbCrLf & vbCrLf & "确认要修改的学号或课程后再进行修改。", _
vbInformation + vbOKOnly, "系统提示"
txtID.SetFocus
txtID.SelStart = 0
txtID.SelLength = Len(txtID.Text)
Exit Sub
Else
sk2 = Trim(txtID.Text)
sk3 = Trim(coblesson.Text)
Unload Me
frmscore1.Show
End If
End Sub
Private Sub List1_Click()
txtID.Text = List1.Text
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -