📄 enactment.frm
字号:
Left = 2040
TabIndex = 24
Top = 3840
Width = 255
End
Begin VB.Label Label13
Caption = "其 他"
Height = 255
Left = 240
TabIndex = 22
Top = 3840
Width = 615
End
Begin VB.Label Label6
Caption = "人"
Height = 255
Index = 3
Left = 2040
TabIndex = 21
Top = 3360
Width = 255
End
Begin VB.Label Label11
Caption = "实验师"
Height = 255
Left = 240
TabIndex = 19
Top = 3360
Width = 615
End
Begin VB.Label Label6
Caption = "人"
Height = 255
Index = 2
Left = 2040
TabIndex = 18
Top = 2880
Width = 255
End
Begin VB.Label Label10
Caption = "技 师"
Height = 255
Left = 240
TabIndex = 16
Top = 2880
Width = 615
End
Begin VB.Label Label9
Caption = "人"
Height = 255
Left = 2040
TabIndex = 15
Top = 2400
Width = 255
End
Begin VB.Label Label8
Caption = "高 工"
Height = 255
Left = 240
TabIndex = 13
Top = 2400
Width = 615
End
Begin VB.Label Label6
Caption = "人"
Height = 255
Index = 1
Left = 2040
TabIndex = 12
Top = 1920
Width = 255
End
Begin VB.Label Label7
Caption = "讲 师"
Height = 255
Left = 240
TabIndex = 11
Top = 1920
Width = 615
End
Begin VB.Label Label6
Caption = "人"
Height = 255
Index = 0
Left = 2040
TabIndex = 10
Top = 1440
Width = 255
End
Begin VB.Label Label5
Caption = "研究员"
Height = 255
Left = 240
TabIndex = 9
Top = 1440
Width = 615
End
Begin VB.Label Label4
Caption = "人"
Height = 255
Left = 2040
TabIndex = 8
Top = 960
Width = 255
End
Begin VB.Label Label3
Caption = "副教授"
Height = 255
Left = 240
TabIndex = 7
Top = 960
Width = 615
End
Begin VB.Label Label2
Caption = "人"
Height = 255
Left = 2040
TabIndex = 6
Top = 480
Width = 255
End
Begin VB.Label Label1
Caption = "教 授"
Height = 255
Left = 240
TabIndex = 5
Top = 480
Width = 615
End
End
End
Attribute VB_Name = "enactment"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Public recocount
Public recocount1
Public recocount2
Public recocount3
Public recocount4
Public recocount5
Public recocount6
Public recocount7
Public recocount8
Private Sub cmdcancel_Click()
Unload Me
End Sub
Private Sub cmdok_add_Click()
Dim mrc As ADODB.Recordset
Dim txtsql As String
Dim msgtext As String
If Trim(Text12.Text) = "" Then
MsgBox "请输入指定人数!", vbOKOnly + vbExclamation, "警告"
Text12.SetFocus
Exit Sub
Else
txtsql = "select * from tustu_repo "
Set mrc = ExecuteSql(txtsql, msgtext)
mrc.AddNew
mrc.Fields(0) = Trim(Combo2.Text)
mrc.Fields(1) = Trim(Text12.Text)
mrc.Update
mrc.Close
End If
txtsql = "select * from tustu_repo where 教工号='" & Trim(Combo2.Text) & " '"
Set mrc = ExecuteSql(txtsql, msgtext)
If mrc.EOF = False Then
MsgBox "该用户已指定人数!", vbOKOnly + vbExclamation, "警告"
mrc.Close
Exit Sub
Else
MsgBox "指定人数成功!", vbOKOnly + vbExclamation, "提示"
Text12.Text = ""
End If
End Sub
Private Sub Combo1_Change()
Dim mrc As ADODB.Recordset
Dim txtsql As String
Dim msgtext As String
'Dim teacher_type As String
txtsql = "select 姓名 from teacher_repo group by 职称"
mrc.Open txtsql, amsgtext
Set mrc = ExecuteSql(txtsql, msgtext)
' teacher_type = Combo1.ListIndex
' Select Case teacher_type
' Case 0:
' txtsql = txtsql & "where 职称='教授'"
'
While Not mrc.EOF
Combo2.AddItem mrc.Fields(1)
mrc.MoveNext
Wend
Combo1.ListIndex = 0
End Sub
Private Sub notdis_Click()
Dim mybookmark As Variant
Dim total As Integer
Dim mrc As ADODB.Recordset
Dim txtsql As String
Dim msgtext As String
txtsql = "select * from tutorstu_repo "
Set mrc = ExecuteSql(txtsql, msgtext)
mybookmark = mrc.Bookmark
total = 0
Do While Not mrc.EOF
total = total + mrc.Fields(5)
mrc.MoveNext
Loop
notdis_total.Text = Trim(Text10.Text) - total
End Sub
Private Sub total_tea_Click()
Dim mrc As ADODB.Recordset
Dim txtsql As String
Dim msgtext As String
recocount1 = 0
recocount2 = 0
recocount3 = 0
recocount4 = 0
recocount5 = 0
recocount6 = 0
recocount7 = 0
recocount8 = 0
txtsql = "select * from teacher_repo "
Set mrc = ExecuteSql(txtsql, msgtext)
Do While Not mrc.EOF
If Trim(mrc.Fields(6)) = "教授" Then
recocount1 = recocount1 + 1
Else
If Trim(mrc.Fields(6)) = "副教授" Then
recocount2 = recocount2 + 1
Else
If Trim(mrc.Fields(6)) = "研究员" Then
recocount3 = recocount3 + 1
Else
If Trim(mrc.Fields(6)) = "讲师" Then
recocount4 = recocount4 + 1
Else
If Trim(mrc.Fields(6)) = "高工" Then
recocount5 = recocount5 + 1
Else
If Trim(mrc.Fields(6)) = "技师" Then
recocount6 = recocount6 + 1
Else
If Trim(mrc.Fields(6)) = "实验师" Then
recocount7 = recocount7 + 1
Else
recocount8 = recocount8 + 1
End If
End If
End If
End If
End If
End If
End If
mrc.MoveNext
Loop
Text1.Text = recocount1
Text2.Text = recocount2
Text3.Text = recocount3
Text4.Text = recocount4
Text5.Text = recocount5
Text6.Text = recocount6
Text7.Text = recocount7
Text8.Text = recocount8
End Sub
Private Sub count_Click()
Dim x As Integer
x = (CInt(Trim(Text10.Text)) + 2 * CInt(Trim(Text2.Text)) + 3 * CInt(Trim(Text3.Text)) + 2 * CInt(Trim(Text4.Text)) + 2 * CInt(Trim(Text5.Text)) + 3 * CInt(Trim(Text6.Text)) + 3 * CInt(Trim(Text7.Text))) \ (CInt(Trim(Text1.Text)) + CInt(Trim(Text2.Text)) + CInt(Trim(Text3.Text)) + CInt(Trim(Text4.Text)) + CInt(Trim(Text5.Text)) + CInt(Trim(Text6.Text)) + CInt(Trim(Text7.Text)))
Text11.Text = x
End Sub
Private Sub total_grad_Click()
Dim mrc As ADODB.Recordset
Dim txtsql As String
Dim msgtext As String
recocount = 0
txtsql = "select * from grad_repo "
Set mrc = ExecuteSql(txtsql, msgtext)
recocount = mrc.RecordCount
Text10.Text = recocount
End Sub
Private Sub show_Click()
tutorstu_repo.show
End Sub
Private Sub Form_Load()
Dim mrc As ADODB.Recordset
Dim txtsql As String
Dim msgtext As String
Combo1.AddItem "全部"
Combo1.AddItem "教授"
Combo1.AddItem "副教授"
Combo1.AddItem "研究员"
Combo1.AddItem "讲师"
Combo1.AddItem "高工"
Combo1.AddItem "技师"
Combo1.AddItem "实验师"
Combo1.ItemData(0) = 0
txtsql = "select * from teacher_repo"
Set mrc = ExecuteSql(txtsql, msgtext)
While Not mrc.EOF
Combo2.AddItem mrc.Fields(1)
mrc.MoveNext
Wend
Combo1.ListIndex = 0
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -