?? 其他工資標(biāo)準(zhǔn)管理.frm
字號:
VERSION 5.00
Begin VB.Form ElseWage
Caption = "其他工資標(biāo)準(zhǔn)管理"
ClientHeight = 5790
ClientLeft = 60
ClientTop = 450
ClientWidth = 6405
LinkTopic = "Form2"
MDIChild = -1 'True
ScaleHeight = 5790
ScaleWidth = 6405
Begin VB.CommandButton cmdExit
Cancel = -1 'True
Caption = "關(guān)閉"
Height = 375
Left = 3480
TabIndex = 3
Top = 4920
Width = 1815
End
Begin VB.CommandButton cmdSave
Caption = "保存"
Default = -1 'True
Height = 375
Left = 720
TabIndex = 2
Top = 4920
Width = 1815
End
Begin VB.Frame Frame2
Caption = "應(yīng)扣工資"
Height = 2295
Left = 240
TabIndex = 1
Top = 2160
Width = 5775
Begin VB.TextBox txtDE
Height = 375
Index = 5
Left = 3840
TabIndex = 23
Top = 1560
Width = 1335
End
Begin VB.TextBox txtDE
Height = 375
Index = 4
Left = 3840
TabIndex = 22
Top = 840
Width = 1335
End
Begin VB.TextBox txtDE
Height = 375
Index = 3
Left = 3840
TabIndex = 21
Top = 240
Width = 1335
End
Begin VB.TextBox txtDE
Height = 375
Index = 2
Left = 1080
TabIndex = 20
Top = 1560
Width = 1335
End
Begin VB.TextBox txtDE
Height = 375
Index = 1
Left = 1080
TabIndex = 19
Top = 960
Width = 1335
End
Begin VB.TextBox txtDE
Height = 375
Index = 0
Left = 1080
TabIndex = 18
Top = 360
Width = 1335
End
Begin VB.Label Label10
AutoSize = -1 'True
Caption = "其他"
Height = 180
Left = 3240
TabIndex = 13
Top = 1680
Width = 360
End
Begin VB.Label Label9
AutoSize = -1 'True
Caption = "房租"
Height = 180
Left = 3240
TabIndex = 12
Top = 1080
Width = 360
End
Begin VB.Label Label8
AutoSize = -1 'True
Caption = "垃圾費(fèi)"
Height = 180
Left = 3060
TabIndex = 11
Top = 360
Width = 540
End
Begin VB.Label Label7
AutoSize = -1 'True
Caption = "醫(yī)療險"
Height = 180
Left = 240
TabIndex = 10
Top = 1560
Width = 540
End
Begin VB.Label Label6
AutoSize = -1 'True
Caption = "失業(yè)險"
Height = 180
Left = 240
TabIndex = 9
Top = 1080
Width = 540
End
Begin VB.Label Label5
AutoSize = -1 'True
Caption = "公積金"
Height = 180
Left = 240
TabIndex = 8
Top = 480
Width = 540
End
End
Begin VB.Frame Frame1
Caption = "應(yīng)發(fā)工資"
Height = 1575
Left = 240
TabIndex = 0
Top = 360
Width = 5775
Begin VB.TextBox txtSE
Height = 375
Index = 3
Left = 3840
TabIndex = 17
Top = 960
Width = 1215
End
Begin VB.TextBox txtSE
Height = 375
Index = 2
Left = 3840
TabIndex = 16
Top = 240
Width = 1215
End
Begin VB.TextBox txtSE
Height = 375
Index = 1
Left = 1080
TabIndex = 15
Top = 960
Width = 1215
End
Begin VB.TextBox txtSE
Height = 375
Index = 0
Left = 1080
TabIndex = 14
Top = 240
Width = 1215
End
Begin VB.Label Label4
AutoSize = -1 'True
Caption = "其他補(bǔ)貼"
Height = 180
Left = 2880
TabIndex = 7
Top = 1080
Width = 720
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "一次性補(bǔ)發(fā)"
Height = 180
Left = 2700
TabIndex = 6
Top = 360
Width = 900
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "住房補(bǔ)貼"
Height = 180
Left = 240
TabIndex = 5
Top = 1080
Width = 720
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "專家津貼"
Height = 180
Left = 240
TabIndex = 4
Top = 360
Width = 720
End
End
End
Attribute VB_Name = "ElseWage"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim isAdding As Boolean
Dim objCn As Connection, objRs As Recordset
Private Sub cmdExit_Click()
Unload Me
End Sub
Private Sub cmdSave_Click()
On Error GoTo DealError
StrNews1 = Array("專家津貼", "住房補(bǔ)貼", "一次性補(bǔ)發(fā)", "其他補(bǔ)貼")
StrNews2 = Array("公積金", "失業(yè)險", "醫(yī)療險", "垃圾費(fèi)", "房租", "其他")
For i = 0 To 3 '驗(yàn)證設(shè)定的工資標(biāo)準(zhǔn)
If txtSE(i) = "" Or Not IsNumeric(txtSE(i)) Then
MsgBox "應(yīng)發(fā)" & StrNews1(i) & "工資標(biāo)準(zhǔn)不能為空,且必須為數(shù)字!", vbCritical, "職務(wù)工資標(biāo)準(zhǔn)設(shè)定"
txtSE(i).SetFocus
txtSE(i).SelStart = 0
txtSE(i).SelLength = Len(txtSE(i))
Exit Sub
End If
Next
For i = 0 To 5
If txtDE(i) = "" Or Not IsNumeric(txtDE(i)) Then
MsgBox "應(yīng)扣" & StrNews2(i) & "工資標(biāo)準(zhǔn)不能為空,且必須為數(shù)字!", vbCritical, "職務(wù)工資標(biāo)準(zhǔn)設(shè)定"
txtDE(i).SetFocus
txtDE(i).SelStart = 0
txtDE(i).SelLength = Len(txtDE(i))
Exit Sub
End If
Next
If objRs.RecordCount = 0 Then objRs.AddNew
For i = 0 To 3
objRs.Fields(i) = txtSE(i)
Next
For i = 0 To 5
objRs.Fields(i + 4) = txtDE(i)
Next
objRs.Update
MsgBox "數(shù)據(jù)保存成功!", vbInformation, "其他工資標(biāo)準(zhǔn)設(shè)定"
Exit Sub
DealError:
msg = "程序執(zhí)行出錯,錯誤信息如下:" & vbCrLf & Err.Description
ShowError msg
End Sub
Private Sub Form_Load()
On Error GoTo DealError
'建立數(shù)據(jù)庫連接
Set objCn = New Connection
strcn = "Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source=" & App.Path & "\工資管理.mdb"
objCn.ConnectionString = strcn
objCn.Open
'創(chuàng)建Recordset對象,獲取系統(tǒng)用戶數(shù)據(jù)
Set objRs = New Recordset
Set objRs.ActiveConnection = objCn
objRs.CursorLocation = adUseClient
objRs.CursorType = adOpenDynamic
objRs.LockType = adLockOptimistic
Strsql = "SELECT * FROM 其他工資"
objRs.Open Strsql
' 顯示數(shù)據(jù)
If objRs.BOF And objRs.EOF Then
MsgBox "無記錄"
Else
For i = 0 To 3
txtSE(i) = objRs.Fields(i)
Next
For i = 0 To 5
txtDE(i) = objRs.Fields(i + 4)
Next
End If
Exit Sub
DealError:
msg = "程序執(zhí)行出錯,錯誤信息如下:" & vbCrLf & Err.Description
ShowError msg
End Sub
Private Sub Form_Unload(Cancel As Integer) '關(guān)閉數(shù)據(jù)庫連接,釋放ADO
Set objRs = Nothing
objCn.Close
Set objCn = Nothing
End Sub
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -