📄 form4.frm
字号:
VERSION 5.00
Begin VB.Form Form4
Caption = "学生成绩管理"
ClientHeight = 6090
ClientLeft = 3120
ClientTop = 1845
ClientWidth = 7485
LinkTopic = "Form4"
ScaleHeight = 6090
ScaleWidth = 7485
Begin VB.Frame Frame1
Caption = "学生成绩查询"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 6015
Left = 0
TabIndex = 0
Top = 0
Width = 7335
Begin VB.CommandButton Command6
Caption = "返回"
Height = 495
Left = 4920
TabIndex = 18
Top = 1920
Width = 855
End
Begin VB.TextBox Text6
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 4680
TabIndex = 17
Top = 3360
Width = 1695
End
Begin VB.CommandButton Command5
Height = 375
Left = 4800
Picture = "Form4.frx":0000
Style = 1 'Graphical
TabIndex = 15
Top = 4680
Width = 855
End
Begin VB.CommandButton Command4
Caption = "删除"
Height = 375
Left = 3960
TabIndex = 14
Top = 4680
Width = 855
End
Begin VB.CommandButton Command3
Caption = "查找"
Height = 375
Left = 3120
TabIndex = 13
Top = 4680
Width = 855
End
Begin VB.CommandButton Command2
Caption = "添加"
Height = 375
Left = 2280
TabIndex = 12
Top = 4680
Width = 855
End
Begin VB.CommandButton Command1
Height = 375
Left = 1320
Picture = "Form4.frx":0442
Style = 1 'Graphical
TabIndex = 11
Top = 4680
Width = 975
End
Begin VB.TextBox Text5
Height = 375
Left = 2040
TabIndex = 10
Top = 3480
Width = 1695
End
Begin VB.TextBox Text4
Height = 375
Left = 2040
TabIndex = 9
Top = 2640
Width = 1695
End
Begin VB.TextBox Text3
Height = 375
Left = 2040
TabIndex = 8
Top = 1920
Width = 1695
End
Begin VB.TextBox Text2
Height = 375
Left = 2040
TabIndex = 7
Top = 1200
Width = 1695
End
Begin VB.TextBox Text1
Height = 375
Left = 2040
TabIndex = 6
Top = 480
Width = 1695
End
Begin VB.Label Label6
Caption = "总成绩:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 4200
TabIndex = 16
Top = 2760
Width = 1095
End
Begin VB.Image Image1
Height = 1695
Left = 4320
Picture = "Form4.frx":0884
Stretch = -1 'True
Top = 360
Width = 2055
End
Begin VB.Label Label5
Caption = "英语"
BeginProperty Font
Name = "楷体_GB2312"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 615
Left = 720
TabIndex = 5
Top = 3480
Width = 1695
End
Begin VB.Label Label4
Caption = "数学:"
BeginProperty Font
Name = "楷体_GB2312"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 615
Left = 720
TabIndex = 4
Top = 2640
Width = 975
End
Begin VB.Label Label3
Caption = "语文:"
BeginProperty Font
Name = "楷体_GB2312"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 720
TabIndex = 3
Top = 1920
Width = 1095
End
Begin VB.Label Label2
Caption = "姓名:"
BeginProperty Font
Name = "楷体_GB2312"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 720
TabIndex = 2
Top = 1200
Width = 975
End
Begin VB.Label Label1
Caption = "班级:"
BeginProperty Font
Name = "楷体_GB2312"
Size = 14.25
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 720
TabIndex = 1
Top = 480
Width = 1575
End
End
End
Attribute VB_Name = "Form4"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim db As Database
Dim cj As Recordset
Private Sub Command1_Click()
On Error Resume Next
cj.MovePrevious
Text1 = cj.Fields("class")
Text2 = cj.Fields("name")
Text3 = cj.Fields("语文")
Text4 = cj.Fields("数学")
Text5 = cj.Fields("英语")
Text6 = cj.Fields("总成绩")
End Sub
Private Sub Command2_Click()
newclass = Text1.Text
newname = Text2.Text
语文 = Text3.Text
数学 = Text4.Text
英语 = Text5.Text
总成绩 = Text6.Text
With cj
.AddNew
!Class = LCase(newclass)
!Name = LCase(newname)
!语文 = LCase(语文)
!数学 = LCase(数学)
!英语 = LCase(英语)
!总成绩 = LCase(总成绩)
.Update
End With
'MsgBox (newName & "was added to the address book")
If MsgBox("是否添加下一条记录!", vbOKCancel) = vbOK Then
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Else
GoTo ine
End If
ine:
End Sub
Private Sub Command3_Click()
Set cj = db.OpenRecordset("select * from cjgl")
总成绩query = InputBox("请输入您所查找的人的总成绩:", "查询")
If MsgBox("请您确定的确要查询此人吗!", 6) <> 1 Then
Exit Sub
End If
Do Until cj.EOF
If cj.Fields("总成绩") Like "*" & LCase(总成绩query) & "*" Then
Text1 = cj.Fields("class")
Text2 = cj.Fields("name")
Text3 = cj.Fields("语文")
Text4 = cj.Fields("数学")
Text5 = cj.Fields("英语")
Text6 = cj.Fields("总成绩")
Exit Sub
Else
cj.MoveNext
End If
Loop
End Sub
Private Sub Command4_Click()
Set cj = db.OpenRecordset("select * from cjgl where cjgl.name")
cj.Delete
cj.MoveNext
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
End Sub
Private Sub Command5_Click()
On Error Resume Next
cj.MoveNext
Text1 = cj.Fields("class")
Text2 = cj.Fields("name")
Text3 = cj.Fields("语文")
Text4 = cj.Fields("数学")
Text5 = cj.Fields("英语")
Text6 = cj.Fields("总成绩")
End Sub
Private Sub Command6_Click()
Me.Hide
frmSplash.Show
End Sub
Private Sub Form_Load()
Set db = OpenDatabase(App.Path & "\学生成绩管理")
Set cj = db.OpenRecordset("cjgl")
If cj.EOF Then
MsgBox "please add someone to the databse"
Else
cj.MoveFirst
Text1 = cj.Fields("class")
Text2 = cj.Fields("name")
Text3 = cj.Fields("语文")
Text4 = cj.Fields("数学")
Text5 = cj.Fields("英语")
Text6 = cj.Fields("总成绩")
End If
End Sub
Private Sub Form_Resize()
Form4.Height = 6450
Form4.Width = 7665
Move (Screen.Width - Me.Width) / 2, (Screen.Height - Me.Height) / 2
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -