📄 form4.frm
字号:
Index = 7
Left = 1080
TabIndex = 40
Text = "Text2"
Top = 3000
Width = 2175
End
Begin VB.TextBox Text2
Height = 270
Index = 6
Left = 1080
TabIndex = 39
Text = "Text2"
Top = 2640
Width = 2175
End
Begin VB.TextBox Text2
Height = 270
Index = 5
Left = 1080
TabIndex = 38
Text = "Text2"
Top = 2280
Width = 2175
End
Begin VB.TextBox Text2
Height = 270
Index = 4
Left = 1080
TabIndex = 37
Text = "Text2"
Top = 1920
Width = 2175
End
Begin VB.TextBox Text2
Height = 270
Index = 3
Left = 1080
TabIndex = 36
Text = "Text2"
Top = 1560
Width = 2175
End
Begin VB.TextBox Text2
Height = 270
Index = 2
Left = 1080
TabIndex = 35
Text = "Text2"
Top = 1200
Width = 2175
End
Begin VB.TextBox Text2
Height = 270
Index = 1
Left = 1080
TabIndex = 34
Text = "Text2"
Top = 840
Width = 2175
End
Begin VB.TextBox Text2
Height = 270
Index = 0
Left = 1080
TabIndex = 33
Text = "Text2"
Top = 480
Width = 2175
End
Begin VB.Label Label12
AutoSize = -1 'True
Caption = "通 讯 费:"
Height = 180
Left = 120
TabIndex = 32
Top = 1920
Width = 900
End
Begin VB.Label Label11
AutoSize = -1 'True
Caption = "额外扣款:"
Height = 180
Left = 120
TabIndex = 31
Top = 3720
Width = 900
End
Begin VB.Label Label10
AutoSize = -1 'True
Caption = "奖 金:"
Height = 180
Left = 120
TabIndex = 30
Top = 3360
Width = 900
End
Begin VB.Label Label9
AutoSize = -1 'True
Caption = "取 暖 费:"
Height = 180
Left = 120
TabIndex = 29
Top = 3000
Width = 900
End
Begin VB.Label Label8
AutoSize = -1 'True
Caption = "水 电 费:"
Height = 180
Left = 120
TabIndex = 28
Top = 2640
Width = 900
End
Begin VB.Label Label7
AutoSize = -1 'True
Caption = "特殊补助:"
Height = 180
Left = 120
TabIndex = 27
Top = 2280
Width = 900
End
Begin VB.Label Label6
AutoSize = -1 'True
Caption = "旅 差 费:"
Height = 180
Left = 120
TabIndex = 26
Top = 1560
Width = 900
End
Begin VB.Label Label5
AutoSize = -1 'True
Caption = "洗 礼费:"
Height = 180
Left = 120
TabIndex = 25
Top = 1200
Width = 900
End
Begin VB.Label Label4
AutoSize = -1 'True
Caption = "姓 名:"
Height = 180
Left = 120
TabIndex = 24
Top = 840
Width = 900
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "编 号:"
Height = 180
Left = 120
TabIndex = 23
Top = 480
Width = 900
End
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "工资管理系统修改流动项"
BeginProperty Font
Name = "宋体"
Size = 15.75
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF0000&
Height = 315
Left = 4080
TabIndex = 0
Top = 0
Width = 3630
End
End
Attribute VB_Name = "Form4"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Combo1_Click()
Text1.SetFocus
Option1.Value = True
Text1.Locked = False
End Sub
Private Sub Combo1_KeyPress(KeyAscii As Integer)
KeyAscii = 0
End Sub
Private Sub Command1_Click(Index As Integer)
Select Case Index
Case 0
Adodc1.Recordset.MoveFirst
Call disp2
Case 1
If Adodc1.Recordset.BOF = False Then
Adodc1.Recordset.MovePrevious
End If
If Adodc1.Recordset.BOF = True Then
Adodc1.Recordset.MoveNext
End If
Call disp2
Case 2
If Adodc1.Recordset.EOF = False Then
Adodc1.Recordset.MoveNext
End If
If Adodc1.Recordset.EOF = True Then
Adodc1.Recordset.MovePrevious
End If
Call disp2
Case 3
Adodc1.Recordset.MoveLast
Call disp2
Case 4
bh1 = InputBox("请输入要查找的职工编号")
Adodc1.Recordset.Find ("编号=" + "'" + bh1 + "'")
If Adodc1.Recordset.EOF = True Then
MsgBox "没有找到匹配的职工记录"
Exit Sub
Else
Call disp2
End If
Case 5
For i = 2 To 9
Text2(i).Locked = False
Next i
Text2(2).SetFocus
For i = 0 To 5
Command1(i).Enabled = False
Next i
Command1(6).Enabled = True
Case 6
For i = 6 To 13
Adodc1.Recordset.Fields(i) = Val(Text2(i - 4).Text)
Next i
s = 0
For i = 2 To 12
s = s + Adodc1.Recordset.Fields(i)
Next i
Adodc1.Recordset.Fields(15) = s
Adodc1.Recordset.Fields(14) = s - Adodc1.Recordset.Fields(13)
Adodc1.Recordset.Update
For i = 0 To 5
Command1(i).Enabled = True
Next i
Command1(6).Enabled = False
Case 7
Call disp2
For i = 0 To 9
Text2(i).Locked = True
Next i
For i = 0 To 5
Command1(i).Enabled = True
Next i
Case 8
Unload Me
End Select
End Sub
Sub disp2()
Text2(0).Text = Adodc1.Recordset.Fields(0)
Text2(1).Text = Adodc1.Recordset.Fields(1)
For i = 6 To 13
Text2(i - 4).Text = Adodc1.Recordset.Fields(i)
Next i
End Sub
Private Sub Command2_Click()
If Combo1.Text = "请选择..." Then
MsgBox "没有选择数据项,不能替换。"
Exit Sub
End If
If Option1.Value = True Then
Adodc1.Refresh
While Adodc1.Recordset.EOF = False
Adodc1.Recordset.Fields(Trim(Combo1.Text)) = Adodc1.Recordset.Fields(Trim(Combo1.Text)) + Val(Text1.Text)
Adodc1.Recordset.MoveNext
Wend
Else
Adodc1.Refresh
While Adodc1.Recordset.EOF = False
Adodc1.Recordset.Fields(Trim(Combo1.Text)) = Adodc1.Recordset.Fields(Trim(Combo1.Text)) - Val(Text1.Text)
Adodc1.Recordset.MoveNext
Wend
End If
Adodc1.Refresh
For k = 6 To 15
DataGrid1.Columns(k).Visible = False
Next k
Call disp2
End Sub
Private Sub Command3_Click()
Combo1.Text = "请选择..."
Text1.Text = ""
Option1.Value = False
Option2.Value = False
End Sub
Private Sub DataGrid1_Click()
disp2
End Sub
Private Sub Form_Activate()
For i = 0 To 9
Text2(i).Text = ""
Text2(i).Locked = True
Next i
Text1.Text = ""
Combo1.Text = "请选择..."
For k = 6 To 13
Combo1.AddItem Data1.Recordset.Fields(k).Name
Next k
For k = 2 To 5
DataGrid1.Columns(k).Visible = False
Next k
For i = 0 To 9
Text2(i).Text = Adodc1.Recordset.Fields(i)
Next i
End Sub
Private Sub Form_Load()
Me.Top = 0
Me.Left = 0
Me.Height = gzglxt.Height - gzglxt.sb1.Height - 750 - gzglxt.Toolbar1.Height
Me.Width = gzglxt.Width - 180
Data1.DatabaseName = App.Path + "\gzglxt.mdb"
Data1.RecordSource = "gzb"
Data1.Refresh
Adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.3.51;Persist Security Info=False;Data Source=" + App.Path + "\gzglxt.mdb"
Adodc1.RecordSource = "gzb"
Adodc1.Refresh
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -