📄 form1.frm
字号:
Index = 11
Left = 1440
TabIndex = 3
Top = 1320
Width = 1095
End
Begin VB.TextBox Text1
Height = 270
Index = 10
Left = 6120
TabIndex = 2
Top = 600
Width = 1095
End
Begin VB.TextBox Text1
Height = 270
Index = 17
Left = 3600
TabIndex = 1
Top = 2520
Width = 1095
End
Begin VB.Label Label17
AutoSize = -1 'True
Caption = "应扣工资"
Height = 180
Left = 5040
TabIndex = 20
Top = 1920
Width = 720
End
Begin VB.Label Label9
AutoSize = -1 'True
Caption = "应发工资"
Height = 180
Left = 2760
TabIndex = 19
Top = 1920
Width = 720
End
Begin VB.Label Label16
AutoSize = -1 'True
Caption = "基本工资"
Height = 180
Left = 600
TabIndex = 18
Top = 600
Width = 720
End
Begin VB.Label Label15
AutoSize = -1 'True
Caption = "奖 金"
Height = 180
Left = 2760
TabIndex = 17
Top = 600
Width = 720
End
Begin VB.Label Label14
AutoSize = -1 'True
Caption = "工资扣款"
Height = 180
Left = 600
TabIndex = 16
Top = 1920
Width = 720
End
Begin VB.Label Label13
AutoSize = -1 'True
Caption = "津 贴"
Height = 180
Left = 5040
TabIndex = 15
Top = 600
Width = 720
End
Begin VB.Label Label12
AutoSize = -1 'True
Caption = "洗 理"
Height = 180
Left = 600
TabIndex = 14
Top = 1320
Width = 720
End
Begin VB.Label Label11
AutoSize = -1 'True
Caption = "书 报"
Height = 180
Left = 2760
TabIndex = 13
Top = 1320
Width = 720
End
Begin VB.Label Label10
AutoSize = -1 'True
Caption = "交 通"
Height = 180
Left = 5040
TabIndex = 12
Top = 1320
Width = 720
End
Begin VB.Label Label18
AutoSize = -1 'True
Caption = "实发工资"
Height = 180
Left = 2760
TabIndex = 11
Top = 2520
Width = 720
End
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
rst.Fields("姓名").Value = CStr(Text1(0).Text)
rst.Fields("政治面貌").Value = CStr(Text1(1).Text)
rst.Fields("职务").Value = CStr(Text1(2).Text)
rst.Fields("科室").Value = CStr(Text1(3).Text)
rst.Fields("生日").Value = CStr(Text1(4).Text)
rst.Fields("军烈属").Value = CStr(Text1(5).Text)
rst.Fields("出勤天数").Value = CStr(Text1(6).Text)
rst.Fields("缺勤天数").Value = CStr(Text1(7).Text)
rst.Fields("基本工资").Value = CStr(Text1(8).Text)
rst.Fields("奖金").Value = CStr(Text1(9).Text)
rst.Fields("津贴").Value = CStr(Text1(10).Text)
rst.Fields("洗理").Value = CStr(Text1(11).Text)
rst.Fields("书报").Value = CStr(Text1(12).Text)
rst.Fields("交通").Value = CStr(Text1(13).Text)
rst.Fields("工资扣").Value = CStr(Text1(14).Text)
rst.Update
Dim rst As New ADODB.Recordset
Dim con As New ADODB.Connection
Dim mysql As String
Dim a, i As Integer
Private Sub Command2_Click(Index As Integer)
Select Case Index
Case 0 '第一条记录
rst.MoveFirst
Command2(0).Enabled = False
Command2(1).Enabled = False
Command2(2).Enabled = True
Command2(3).Enabled = True
Case 1 '上一条记录
rst.MovePrevious '上一条
If rst.BOF Then
MsgBox "已经没有上一条记录了", 48, "警告"
rst.MoveFirst
Command2(0).Enabled = False
Command2(1).Enabled = False
Command2(2).Enabled = True
Command2(3).Enabled = True
End If
Command2(2).Enabled = True
Command2(3).Enabled = True
Case 2 '下一条记录
rst.MoveNext
If rst.EOF Then
MsgBox "已经没有最后一条记录了", 48, "警告"
Command2_Click (3)
rst.MoveLast
Command2(2).Enabled = False
Command2(3).Enabled = False
Command2(1).Enabled = True
Command2(0).Enabled = True
End If
Command2(1).Enabled = True
Command2(0).Enabled = True
Case 3 '末尾一条记录
rst.MoveLast
Command2(2).Enabled = False
Command2(3).Enabled = False
Command2(1).Enabled = True
Command2(0).Enabled = True
Case 4
Form1.Show
Case 5
Form9.Show
Case 6
Me.Hide '关闭
End Select
Text1(0).Text = IIf(IsNull(rst.Fields("姓名").Value), "", rst.Fields("姓名").Value) '填充记录
Text1(1).Text = IIf(IsNull(rst.Fields("政治面貌").Value), "", rst.Fields("政治面貌").Value) '填充记录
Text1(2).Text = IIf(IsNull(rst.Fields("职务").Value), "", rst.Fields("职务").Value) '填充记录
Text1(3).Text = IIf(IsNull(rst.Fields("科室").Value), "", rst.Fields("科室").Value) '填充记录
Text1(4).Text = IIf(IsNull(rst.Fields("生日").Value), "", rst.Fields("生日").Value) '填充记录
Text1(5).Text = IIf(IsNull(rst.Fields("军烈属").Value), "", rst.Fields("军烈属").Value) '填充记录
Text1(6).Text = IIf(IsNull(rst.Fields("出勤天数").Value), "", rst.Fields("出勤天数").Value) '填充记录
Text1(7).Text = IIf(IsNull(rst.Fields("缺勤天数").Value), "", rst.Fields("缺勤天数").Value) '填充记录
Text1(8).Text = IIf(IsNull(rst.Fields("基本工资").Value), "", rst.Fields("基本工资").Value) '填充记录
Text1(9).Text = IIf(IsNull(rst.Fields("奖金").Value), "", rst.Fields("奖金").Value) '填充记录
Text1(10).Text = IIf(IsNull(rst.Fields("津贴").Value), "", rst.Fields("津贴").Value) '填充记录
Text1(11).Text = IIf(IsNull(rst.Fields("洗理").Value), "", rst.Fields("洗理").Value) '填充记录
Text1(12).Text = IIf(IsNull(rst.Fields("书报").Value), "", rst.Fields("书报").Value) '填充记录
Text1(13).Text = IIf(IsNull(rst.Fields("交通").Value), "", rst.Fields("交通").Value) '填充记录
Text1(14).Text = IIf(IsNull(rst.Fields("工资扣").Value), "", rst.Fields("工资扣").Value) '填充记录
Text1(15).Text = Val(Text1(8).Text) + Val(Text1(9).Text) + Val(Text1(10).Text) + Val(Text1(11).Text) + Val(Text1(12).Text) + Val(Text1(13).Text)
Text1(16).Text = Text1(14).Text
Text1(17).Text = Val(Text1(15).Text) - Val(Text1(16).Text)
End Sub
Private Sub Form_Load()
Set con = New ADODB.Connection
a = Text1.Count
con.ConnectionString = "provider=microsoft.jet.oledb.4.0;data source=gzgl.mdb;persist security info=false"
con.CursorLocation = adUseClient
con.Open
rst.Open "select * from 员工信息,工资总 where 员工信息.编号=工资总.编号", con, adOpenKeyset, adLockOptimistic
If rst.BOF = True Or rst.EOF Then
MsgBox "数据库是空的!"
Else
Text1(0).Text = rst.Fields("姓名").Value
Text1(1).Text = rst.Fields("政治面貌").Value
Text1(2).Text = rst.Fields("职务").Value
Text1(3).Text = rst.Fields("科室").Value
Text1(4).Text = rst.Fields("生日").Value
Text1(5).Text = rst.Fields("军烈属").Value
Text1(6).Text = rst.Fields("出勤天数").Value
Text1(7).Text = rst.Fields("缺勤天数").Value
Text1(8).Text = rst.Fields("基本工资").Value
Text1(9).Text = rst.Fields("奖金").Value
Text1(10).Text = rst.Fields("津贴").Value
Text1(11).Text = rst.Fields("洗理").Value
Text1(12).Text = rst.Fields("书报").Value
Text1(13).Text = rst.Fields("交通").Value
Text1(14).Text = rst.Fields("工资扣").Value
Text1(15).Text = Val(Text1(8).Text) + Val(Text1(9).Text) + Val(Text1(10).Text) + Val(Text1(11).Text) + Val(Text1(12).Text) + Val(Text1(13).Text)
Text1(16).Text = Text1(14).Text
Text1(17).Text = Val(Text1(15).Text) - Val(Text1(16).Text)
End If
For i = 0 To a - 1
Text1(i).Enabled = False
Next i
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -