📄 frmpcl.frm
字号:
VERSION 5.00
Object = "{BDC217C8-ED16-11CD-956C-0000C04E4C0A}#1.1#0"; "tabctl32.ocx"
Begin VB.Form frmpcl
Caption = "批处理"
ClientHeight = 3930
ClientLeft = 60
ClientTop = 345
ClientWidth = 5940
Icon = "frmpcl.frx":0000
LinkTopic = "Form1"
ScaleHeight = 3930
ScaleWidth = 5940
StartUpPosition = 1 '所有者中心
Begin VB.CommandButton Command2
Cancel = -1 'True
Caption = "退出(&C)"
Height = 495
Left = 4560
TabIndex = 1
Top = 3330
Width = 1065
End
Begin VB.CommandButton Command1
Caption = "确定(&O)"
Default = -1 'True
Height = 495
Left = 3360
TabIndex = 0
Top = 3360
Width = 1065
End
Begin TabDlg.SSTab SSTab1
Height = 3045
Left = 150
TabIndex = 2
Top = 150
Width = 5505
_ExtentX = 9710
_ExtentY = 5371
_Version = 393216
Tabs = 2
TabHeight = 520
TabCaption(0) = "增加基本信息"
TabPicture(0) = "frmpcl.frx":0442
Tab(0).ControlEnabled= -1 'True
Tab(0).Control(0)= "Label2"
Tab(0).Control(0).Enabled= 0 'False
Tab(0).Control(1)= "Label1"
Tab(0).Control(1).Enabled= 0 'False
Tab(0).Control(2)= "Text1"
Tab(0).Control(2).Enabled= 0 'False
Tab(0).Control(3)= "Combo1"
Tab(0).Control(3).Enabled= 0 'False
Tab(0).Control(4)= "Frame1"
Tab(0).Control(4).Enabled= 0 'False
Tab(0).ControlCount= 5
TabCaption(1) = "删除毕业学生"
TabPicture(1) = "frmpcl.frx":045E
Tab(1).ControlEnabled= 0 'False
Tab(1).Control(0)= "Label3"
Tab(1).Control(0).Enabled= 0 'False
Tab(1).Control(1)= "Combo2"
Tab(1).Control(1).Enabled= 0 'False
Tab(1).ControlCount= 2
Begin VB.Frame Frame1
Height = 945
Left = 240
TabIndex = 9
Top = 420
Width = 3615
Begin VB.OptionButton Option5
Caption = "退休"
Height = 225
Left = 2430
TabIndex = 14
Top = 240
Width = 765
End
Begin VB.OptionButton Option4
Caption = "统筹"
Height = 255
Left = 1290
TabIndex = 13
Top = 570
Width = 735
End
Begin VB.OptionButton Option3
Caption = "学生 "
Height = 225
Left = 1290
TabIndex = 12
Top = 240
Width = 1035
End
Begin VB.OptionButton Option2
Caption = "教工"
Height = 225
Left = 150
TabIndex = 11
Top = 570
Width = 915
End
Begin VB.OptionButton Option1
Caption = "全部"
Height = 255
Left = 150
TabIndex = 10
Top = 240
Width = 1095
End
End
Begin VB.ComboBox Combo2
BackColor = &H00C0FFFF&
Height = 300
Left = -72900
TabIndex = 7
Top = 840
Width = 1725
End
Begin VB.ComboBox Combo1
BackColor = &H00C0FFFF&
Height = 300
Left = 2010
TabIndex = 4
Top = 1530
Width = 1845
End
Begin VB.TextBox Text1
BackColor = &H00C0FFFF&
Height = 315
Left = 2010
TabIndex = 3
Top = 1950
Width = 1815
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "请选择删除的学生"
ForeColor = &H000000C0&
Height = 195
Left = -74640
TabIndex = 8
Top = 870
Width = 1440
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "请选择增加的字段"
Height = 180
Left = 240
TabIndex = 6
Top = 1560
Width = 1440
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "请输入改变后的值"
Height = 180
Left = 240
TabIndex = 5
Top = 2010
Width = 1440
End
End
End
Attribute VB_Name = "frmpcl"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Combo1_Click()
If Combo1.Text = "增加工龄" Then
Text1.Enabled = False
Command1.SetFocus
Else
Text1.Enabled = True
Text1.SetFocus
End If
End Sub
Private Sub Command1_Click()
'On Error GoTo err
Call condatabase
Set rsrmkpcl = New ADODB.Recordset
If SSTab1.Tab = 0 Then
Select Case Combo1.Text
Case "增加工龄"
Text1.Enabled = False
Frame1.Enabled = False
rsrmkpcl.open "update rmk set 工龄=工龄+1", cn, adOpenStatic, adLockPessimistic
MsgBox "完成增加工龄操作!", vbOKOnly + vbExclamation, "注意了:)"
Case "增加补偿金"
Text1.Enabled = True
If Option1.Value = True Then
rsrmkpcl.open "update rmk set 补偿金=' " & Text1.Text & "'", cn, adOpenStatic, adLockPessimistic
ElseIf Option2.Value = True Then
rsrmkpcl.open "update rmk set 补偿金=' " & Text1.Text & "' where 号码 like '00%'", cn, adOpenStatic, adLockPessimistic
ElseIf Option3.Value = True Then
rsrmkpcl.open "update rmk set 补偿金=' " & Text1.Text & "' where 号码 like '9%'", cn, adOpenStatic, adLockPessimistic
ElseIf Option4.Value = True Then
rsrmkpcl.open "update rmk set 补偿金=' " & Text1.Text & "' where 号码 like 'TC%'", cn, adOpenStatic, adLockPessimistic
ElseIf Option5.Value = True Then
rsrmkpcl.open "update rmk set 补偿金=' " & Text1.Text & "' where 号码 like 'TX%'", cn, adOpenStatic, adLockPessimistic
End If
MsgBox "完成增加补偿金操作!", vbOKOnly + vbExclamation, "注意了:)"
Case "增加定额"
Text1.Enabled = True
If Option1.Value = True Then
rsrmkpcl.open "update rmk set 定额=' " & Text1.Text & "'", cn, adOpenStatic, adLockPessimistic
ElseIf Option2.Value = True Then
rsrmkpcl.open "update rmk set 定额=' " & Text1.Text & "' where 号码 like '00%'", cn, adOpenStatic, adLockPessimistic
ElseIf Option3.Value = True Then
rsrmkpcl.open "update rmk set 定额=' " & Text1.Text & "' where 号码 like '9%'", cn, adOpenStatic, adLockPessimistic
ElseIf Option4.Value = True Then
rsrmkpcl.open "update rmk set 定额=' " & Text1.Text & "' where 号码 like 'TC%'", cn, adOpenStatic, adLockPessimistic
ElseIf Option5.Value = True Then
rsrmkpcl.open "update rmk set 定额=' " & Text1.Text & "' where 号码 like 'TX%'", cn, adOpenStatic, adLockPessimistic
End If
MsgBox "完成增加定额操作!", vbOKOnly + vbExclamation, "注意了:)"
End Select
ElseIf SSTab1.Tab = 1 Then
Dim msg As String
msg = "是否删除所有毕业生纪录!"
t = MsgBox(msg, vbOKCancel + vbExclamation, "注意了:)")
If t = 1 Then
rsrmkpcl.open "select * from rmk where 号码 like '" & Combo2.Text & "%" & "'", cn, adOpenStatic, adLockPessimistic
Do Until rsrmkpcl.EOF
rsrmkpcl.Delete
rsrmkpcl.MoveNext
Loop
MsgBox "完成删除毕业生操作!", vbOKOnly + vbExclamation, "注意了:)"
Else
Exit Sub
End If
End If
Exit Sub
'err:
' MsgBox err.Description, vbOKOnly + vbCritical, "错误"
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Form_Load()
Combo1.AddItem "增加工龄"
Combo1.AddItem "增加补偿金"
Combo1.AddItem "增加定额"
End Sub
Private Sub Form_Unload(Cancel As Integer)
mainform.StatusBar1.Panels(1).Text = "状态: 无"
End Sub
Private Sub SSTab1_Click(PreviousTab As Integer)
Call condatabase
Set rsrmkpcl = New ADODB.Recordset
If SSTab1.Tab = 1 Then
If rsrmkpcl.State = 1 Then
rsrmkpcl.close
End If
rsrmkpcl.open "select distinct left(号码,2) from rmk where 号码 like '9%'", cn, adOpenStatic, adLockPessimistic
Combo2.Clear
Do Until rsrmkpcl.EOF
Combo2.AddItem rsrmkpcl.Fields(0)
rsrmkpcl.MoveNext
Loop
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -