📄 form3.frm
字号:
End
Begin VB.TextBox Text4
Height = 375
Left = 1320
TabIndex = 15
Text = "Text4"
Top = 2280
Width = 2055
End
Begin VB.TextBox Text5
Height = 375
Left = 1320
TabIndex = 14
Text = "Text5"
Top = 3000
Width = 2055
End
Begin VB.TextBox Text6
Height = 375
Left = 1320
TabIndex = 13
Text = "Text6"
Top = 3720
Width = 2055
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "编 号:"
Height = 180
Left = 360
TabIndex = 24
Top = 480
Width = 900
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "姓 名:"
Height = 180
Left = 360
TabIndex = 23
Top = 1080
Width = 900
End
Begin VB.Label Label4
AutoSize = -1 'True
Caption = "基本工资:"
Height = 180
Left = 360
TabIndex = 22
Top = 1680
Width = 900
End
Begin VB.Label Label5
AutoSize = -1 'True
Caption = "工龄工资:"
Height = 180
Left = 240
TabIndex = 21
Top = 2400
Width = 900
End
Begin VB.Label Label6
AutoSize = -1 'True
Caption = "副食补贴:"
Height = 180
Left = 240
TabIndex = 20
Top = 3120
Width = 900
End
Begin VB.Label Label7
AutoSize = -1 'True
Caption = "粮食补贴:"
Height = 180
Left = 240
TabIndex = 19
Top = 3840
Width = 900
End
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "工资管理系统修改固定项"
BeginProperty Font
Name = "宋体"
Size = 15
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H000000FF&
Height = 300
Left = 4200
TabIndex = 0
Top = 120
Width = 3465
End
End
Attribute VB_Name = "Form3"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Adodc1.Recordset.MoveFirst
Call disp1
End Sub
Private Sub Command2_Click()
If Adodc1.Recordset.BOF = False Then
Adodc1.Recordset.MovePrevious
End If
If Adodc1.Recordset.BOF = True Then
Adodc1.Recordset.MoveNext
End If
Call disp1
End Sub
Private Sub Command3_Click()
If Adodc1.Recordset.EOF = False Then
Adodc1.Recordset.MoveNext
End If
If Adodc1.Recordset.EOF = True Then
Adodc1.Recordset.MovePrevious
End If
Call disp1
End Sub
Private Sub Command4_Click()
Adodc1.Recordset.MoveLast
Call disp1
End Sub
Private Sub Command5_Click()
bh1 = InputBox("请输入你要查找的职工的编号。")
If bh1 = "" Then Exit Sub
Adodc1.Refresh
Adodc1.Recordset.Find ("编号=" + "'" + bh1 + "'")
If Adodc1.Recordset.EOF = True Then
MsgBox "没有找到编号为 " + bh1 + " 的职工记录"
Adodc1.Refresh
Else
Call disp1
End If
Command5.Enabled = False
End Sub
Private Sub Command6_Click()
Command1.Enabled = False
Command2.Enabled = False
Command3.Enabled = False
Command4.Enabled = False
Command5.Enabled = False
Command6.Enabled = False
Command7.Enabled = True
Text1.Locked = False
Text2.Locked = False
Text3.Locked = False
Text4.Locked = False
Text5.Locked = False
Text6.Locked = False
Text1.SetFocus
Text1.SelStart = Len(Text1.Text)
End Sub
Private Sub Command7_Click()
If Len(Trim(Text1.Text)) >= 4 Then
Data1.Recordset.FindFirst "bmbh=" + "'" + Mid(Text1.Text, 1, 2) + "'"
If Data1.Recordset.NoMatch = False Then
MsgBox "编号修改错误,请重新修改"
Text1.Text = ""
Text1.SetFocus
Else
Text2.SetFocus
End If
End If
Adodc1.Recordset.Fields(0) = Text1.Text
Adodc1.Recordset.Fields(1) = Text2.Text
Adodc1.Recordset.Fields(2) = Val(Text3.Text)
Adodc1.Recordset.Fields(3) = Val(Text4.Text)
Adodc1.Recordset.Fields(4) = Val(Text5.Text)
Adodc1.Recordset.Fields(5) = Val(Text6.Text)
s = 0
For k = 2 To 12
s = s + Adodc1.Recordset.Fields(k)
Next k
Adodc1.Recordset.Fields(14) = s
Adodc1.Recordset.Fields(15) = s - Adodc1.Recordset.Fields(13)
Adodc1.Recordset.Update
MsgBox "修改成功"
Command1.Enabled = True
Command2.Enabled = True
Command3.Enabled = True
Command4.Enabled = True
Command5.Enabled = True
Command6.Enabled = True
Command7.Enabled = False
Command1.SetFocus
End Sub
Private Sub Command8_Click()
Call disp1
Command1.Enabled = True
Command2.Enabled = True
Command3.Enabled = True
Command4.Enabled = True
Command5.Enabled = True
Command6.Enabled = True
Command7.Enabled = False
Text1.Locked = True
Text2.Locked = True
Text3.Locked = True
Text4.Locked = True
Text5.Locked = True
Text6.Locked = True
End Sub
Private Sub Command9_Click()
Unload Me
End Sub
Private Sub DataGrid1_Click()
Call disp1
End Sub
Private Sub Form_Activate()
For k = 6 To 15
DataGrid1.Columns(k).Visible = False
Next k
Call disp1
Command1.SetFocus
End Sub
Sub disp1()
Text1.Text = Adodc1.Recordset.Fields(0)
Text2.Text = Adodc1.Recordset.Fields(1)
Text3.Text = Adodc1.Recordset.Fields(2)
Text4.Text = Adodc1.Recordset.Fields(3)
Text5.Text = Adodc1.Recordset.Fields(4)
Text6.Text = Adodc1.Recordset.Fields(5)
Text1.Locked = True
Text2.Locked = True
Text3.Locked = True
Text4.Locked = True
Text5.Locked = True
Text6.Locked = True
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
Adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.3.51;Persist Security Info=False;Data Source=" + App.Path + "\gzglxt.mdb"
Adodc1.RecordSource = "gzb"
Adodc1.Refresh
Data1.DatabaseName = App.Path + "\gzglxt.mdb"
Data1.RecordSource = "bmk"
Data1.Refresh
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -