📄 frmmoney.frm
字号:
VERSION 5.00
Begin VB.Form frmmoney
Caption = "补交学费"
ClientHeight = 8385
ClientLeft = 60
ClientTop = 450
ClientWidth = 6810
LinkTopic = "Form1"
MDIChild = -1 'True
ScaleHeight = 8385
ScaleWidth = 6810
Begin VB.Frame Frame1
Caption = "按班别显示"
Height = 3495
Left = 120
TabIndex = 23
Top = 120
Width = 6615
Begin VB.PictureBox Picture1
BorderStyle = 0 'None
Height = 255
Left = 120
ScaleHeight = 255
ScaleWidth = 6255
TabIndex = 34
Top = 720
Width = 6255
Begin VB.OptionButton Option2
Caption = "按姓名显示"
Height = 255
Left = 3120
TabIndex = 36
Top = 0
Width = 1575
End
Begin VB.OptionButton Option1
Caption = "按学号显示"
Height = 255
Left = 0
TabIndex = 35
Top = 0
Width = 1815
End
End
Begin VB.ComboBox cobsp
Height = 300
Left = 960
TabIndex = 27
Text = "cobsp"
Top = 360
Width = 1935
End
Begin VB.ComboBox cobclass
Height = 300
Left = 4080
TabIndex = 26
Text = "cobclass"
Top = 360
Width = 2055
End
Begin VB.ListBox List1
Height = 1860
Left = 120
TabIndex = 25
Top = 1080
Width = 6255
End
Begin VB.CommandButton Command1
Caption = "确定"
Height = 375
Left = 2640
TabIndex = 24
Top = 3000
Width = 975
End
Begin VB.Label Label1
Caption = "专业:"
Height = 255
Left = 240
TabIndex = 29
Top = 360
Width = 615
End
Begin VB.Label Label2
Caption = "班别:"
Height = 255
Left = 3600
TabIndex = 28
Top = 360
Width = 735
End
End
Begin VB.Frame Frame2
Caption = "直接输入学号"
Height = 1215
Left = 120
TabIndex = 19
Top = 3720
Width = 6615
Begin VB.TextBox txtnumber
Height = 270
Left = 1200
TabIndex = 21
Text = "txtnumber"
Top = 360
Width = 3015
End
Begin VB.CommandButton Command2
Caption = "确定"
Height = 375
Left = 2640
TabIndex = 20
Top = 720
Width = 975
End
Begin VB.Label Label3
Caption = "输入学号:"
Height = 255
Left = 240
TabIndex = 22
Top = 360
Width = 975
End
End
Begin VB.Frame Frame3
Caption = "交费情况"
Height = 3255
Left = 120
TabIndex = 0
Top = 5040
Width = 6615
Begin VB.TextBox txtsecond
Height = 270
Left = 1560
TabIndex = 32
Text = "txtsecond"
Top = 2160
Width = 1695
End
Begin VB.TextBox txtnumber1
Height = 270
Left = 840
TabIndex = 8
Text = "txtnumber1"
Top = 360
Width = 1935
End
Begin VB.TextBox txtname1
Height = 270
Left = 4200
TabIndex = 7
Text = "txtname1"
Top = 360
Width = 1935
End
Begin VB.ComboBox cobyear
Height = 300
Left = 840
TabIndex = 6
Text = "cobyear"
Top = 720
Width = 1935
End
Begin VB.TextBox txtmust
Height = 270
Left = 1560
TabIndex = 5
Text = "txtmust"
Top = 1440
Width = 1695
End
Begin VB.TextBox txtat
Height = 270
Left = 1560
TabIndex = 4
Text = "txtat"
Top = 1800
Width = 1695
End
Begin VB.TextBox txtqian
Height = 270
Left = 4560
TabIndex = 3
Text = "txtqian"
Top = 1800
Width = 1575
End
Begin VB.CommandButton Command3
Caption = "确定"
Height = 375
Left = 1800
TabIndex = 2
Top = 2640
Width = 855
End
Begin VB.CommandButton Command4
Caption = "返回"
Height = 375
Left = 3480
TabIndex = 1
Top = 2640
Width = 855
End
Begin VB.Label Label10
Caption = "元"
Height = 255
Index = 3
Left = 3360
TabIndex = 33
Top = 2160
Width = 255
End
Begin VB.Label Label13
Caption = "补交:"
Height = 255
Left = 240
TabIndex = 31
Top = 2160
Width = 855
End
Begin VB.Label Label12
Height = 255
Left = 3720
TabIndex = 30
Top = 1440
Width = 1815
End
Begin VB.Label Label4
Caption = "学号:"
Height = 255
Left = 240
TabIndex = 18
Top = 360
Width = 615
End
Begin VB.Label Label5
Caption = "姓名:"
Height = 255
Left = 3720
TabIndex = 17
Top = 360
Width = 615
End
Begin VB.Label Label6
Caption = "学年:"
Height = 255
Left = 240
TabIndex = 16
Top = 720
Width = 615
End
Begin VB.Label Label7
Caption = "本学期应交费:"
Height = 255
Left = 240
TabIndex = 15
Top = 1440
Width = 1335
End
Begin VB.Label Label8
Caption = "实际交费:"
Height = 255
Left = 240
TabIndex = 14
Top = 1800
Width = 1215
End
Begin VB.Label Label9
Caption = "欠费:"
ForeColor = &H000000FF&
Height = 255
Left = 3720
TabIndex = 13
Top = 1800
Width = 975
End
Begin VB.Label Label10
Caption = "元"
Height = 255
Index = 0
Left = 3360
TabIndex = 12
Top = 1440
Width = 255
End
Begin VB.Label Label10
Caption = "元"
Height = 255
Index = 1
Left = 3360
TabIndex = 11
Top = 1800
Width = 255
End
Begin VB.Label Label10
Caption = "元"
Height = 255
Index = 2
Left = 6240
TabIndex = 10
Top = 1800
Width = 255
End
Begin VB.Label Label11
Height = 255
Left = 3720
TabIndex = 9
Top = 2160
Width = 1455
End
End
End
Attribute VB_Name = "frmmoney"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim sp, class As String
Private Sub Command1_Click()
Dim sCon As String
Dim scon1 As String
If Option1.Value = True Then
sCon = "select * from 交费 where 学号='" & Trim(List1.Text) & "'"
End If
If Option2.Value = True Then
sCon = "select * from 交费 where 姓名='" & Trim(List1.Text) & "'"
End If
If Option1.Value = False And Option2.Value = False Then
MsgBox "请选择查询方式!", vbOKOnly + vbExclamation, "系统提示"
Exit Sub
End If
Set adoRS = adoCon.Execute(sCon)
If adoRS.EOF Then
MsgBox Trim(List1.Text) & "的学生资料不存在!", vbOKOnly + vbExclamation, "系统提示"
cobclass.SetFocus
Exit Sub
Else
txtnumber1.Text = adoRS("学号")
txtname1.Text = adoRS("姓名")
sp = adoRS("专业")
class = adoRS("班别")
txtmust.Text = adoRS("应交费")
txtat.Text = adoRS("实交")
txtqian.Text = adoRS("欠费")
cobyear.Text = adoRS("学年")
End If
If Val(txtqian.Text) = 0 Then
Label12.Caption = "该生不需要补交学费!"
End If
End Sub
Private Sub Command2_Click()
SQL = "select * from 交费 where 学号='" & Trim(txtNumber.Text) & "'"
Set adoRS = adoCon.Execute(SQL)
If adoRS.EOF Then
MsgBox Trim(txtNumber.Text) & "的学生资料不存在!", vbOKOnly + vbExclamation, "系统提示"
cobclass.SetFocus
Exit Sub
Else
txtnumber1.Text = adoRS("学号")
txtname1.Text = adoRS("姓名")
sp = adoRS("专业")
class = adoRS("班别")
txtmust.Text = adoRS("应交费")
txtat.Text = adoRS("实交")
txtqian.Text = adoRS("欠费")
cobyear.Text = adoRS("学年")
End If
If Val(txtqian.Text) = 0 Then
Label12.Caption = "该生不需要补交学费!"
End If
End Sub
Private Sub Command3_Click()
SQL = ""
SQL = "update 交费 set 学号='" & txtnumber1.Text & "',"
SQL = SQL & "姓名='" & txtname1.Text & "',"
SQL = SQL & "专业='" & sp & "',"
SQL = SQL & "班别='" & class & "',"
SQL = SQL & "学年='" & cobyear.Text & "',"
SQL = SQL & "应交费='" & txtmust.Text & "',"
SQL = SQL & "实交='" & txtat.Text & "',"
SQL = SQL & "欠费='" & txtqian.Text & "'"
SQL = SQL & " Where 学号='" & Trim(txtnumber1.Text) & "'"
adoCon.Execute (SQL)
SQL = MsgBox("修改成功!", vbInformation _
+ vbOK, "系统提示")
txtnumber1.Text = ""
txtname1.Text = ""
txtmust.Text = ""
txtat.Text = ""
txtqian.Text = ""
txtsecond.Text = ""
End Sub
Private Sub Command4_Click()
Unload Me
frmassist.Label1.Caption = "欢迎使用本系统!如有什么意见请及时向我们提出!谢谢!"
End Sub
Private Sub Form_Load()
Me.Height = 9030
Me.Width = 6975
Me.Move (Screen.Width - Me.Width) / 2, (Screen.Height - Me.Height) / 2 - 800
'专业
Set adoRS = adoCon.Execute("Select Name From Speciality Order By Name")
cobsp.Clear
Do While Not adoRS.EOF
cobsp.AddItem Trim(adoRS("Name"))
adoRS.MoveNext
Loop
cobsp.ListIndex = 0
txtname1.Text = ""
txtNumber.Text = ""
txtnumber1.Text = ""
cobyear.Clear
For i = 1990 To 2050
With cobyear
.AddItem i
End With
Next i
txtmust.Text = ""
txtat.Text = ""
txtqian.Text = ""
txtsecond.Text = ""
End Sub
Private Sub cobsp_Click()
'班级
SQL = ""
SQL = "select 班级 from Spclass where 专业='" & cobsp.Text & "'"
Set adoRS = adoCon.Execute(SQL)
cobclass.Clear
Do While Not adoRS.EOF
cobclass.AddItem Trim(adoRS("班级"))
adoRS.MoveNext
Loop
Option1.Value = False
Option2.Value = False
End Sub
Private Sub cobclass_Click()
If Option1.Value = True Then
Option1.Value = False
End If
If Option2.Value = True Then
Option2.Value = False
End If
End Sub
Private Sub Option1_Click()
'学号
SQL = "select * from Student where Class='" & Trim(cobclass.Text) & "' order by ID "
Set adoRS = adoCon.Execute(SQL)
List1.Clear
Do While adoRS.EOF
MsgBox "无资料!", vbOKOnly + vbExclamation, "系统提示"
Exit Sub
Loop
If cobclass.Text = "" Then
MsgBox "请选择班级!", vbOKOnly + vbExclamation, "系统提示"
End If
Do While Not adoRS.EOF
List1.AddItem adoRS("ID")
adoRS.MoveNext
Loop
End Sub
Private Sub Option2_Click()
'姓名
SQL = "select * from Student where Class='" & Trim(cobclass.Text) & "' order by ID "
Set adoRS = adoCon.Execute(SQL)
List1.Clear
Do While adoRS.EOF
MsgBox "无资料!", vbOKOnly + vbExclamation, "系统提示"
Exit Sub
Loop
If cobclass.Text = "" Then
MsgBox "请选择班级!", vbOKOnly + vbExclamation, "系统提示"
End If
Do While Not adoRS.EOF
List1.AddItem adoRS("Name")
adoRS.MoveNext
Loop
End Sub
Private Sub txtsecond_Change()
Label11.Caption = "输入后请按回车"
End Sub
Private Sub txtsecond_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
txtqian.Text = Val(Trim(txtqian.Text)) - Val(Trim(txtsecond.Text))
txtat.Text = Val(Trim(txtat.Text)) + Val(Trim(txtsecond.Text))
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -