?? frmformula.frm
字號:
VERSION 5.00
Begin VB.Form frmFormula
Caption = "計算公式"
ClientHeight = 6600
ClientLeft = 60
ClientTop = 345
ClientWidth = 5535
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 6600
ScaleWidth = 5535
StartUpPosition = 2 '屏幕中心
Begin VB.CommandButton cmdCancel
Caption = "取 消"
Height = 615
Left = 3720
TabIndex = 8
Top = 5520
Width = 1335
End
Begin VB.CommandButton cmdDefault
Caption = "恢復默認值"
Height = 615
Left = 2040
TabIndex = 7
Top = 5520
Width = 1335
End
Begin VB.CommandButton cmdOK
Caption = "設 置"
Height = 615
Left = 360
TabIndex = 6
Top = 5520
Width = 1335
End
Begin VB.TextBox textLE
BeginProperty Font
Name = "楷體_GB2312"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 840
TabIndex = 5
Top = 4200
Width = 855
End
Begin VB.TextBox textAbsent
BeginProperty Font
Name = "楷體_GB2312"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 840
TabIndex = 4
Top = 3600
Width = 855
End
Begin VB.TextBox textErrand
BeginProperty Font
Name = "楷體_GB2312"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 840
TabIndex = 3
Top = 3000
Width = 855
End
Begin VB.TextBox textOvertimeSpe
BeginProperty Font
Name = "楷體_GB2312"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 2040
TabIndex = 2
Top = 2400
Width = 855
End
Begin VB.TextBox textOvertimeCom
BeginProperty Font
Name = "楷體_GB2312"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 2040
TabIndex = 1
Top = 1800
Width = 855
End
Begin VB.Label Label13
Caption = "(元/次)×遲到早退次數"
BeginProperty Font
Name = "楷體_GB2312"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H80000001&
Height = 375
Left = 1800
TabIndex = 20
Top = 4200
Width = 3615
End
Begin VB.Label Label12
Caption = "-"
BeginProperty Font
Name = "楷體_GB2312"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H80000001&
Height = 375
Left = 360
TabIndex = 19
Top = 4200
Width = 375
End
Begin VB.Label Label11
Caption = "+獎金+福利等-其他扣發"
BeginProperty Font
Name = "楷體_GB2312"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H80000001&
Height = 375
Left = 240
TabIndex = 18
Top = 4800
Width = 3135
End
Begin VB.Label Label10
Caption = "(元/天)×曠工次數"
BeginProperty Font
Name = "楷體_GB2312"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H80000001&
Height = 375
Left = 1800
TabIndex = 17
Top = 3600
Width = 3495
End
Begin VB.Label Label9
Caption = "-"
BeginProperty Font
Name = "楷體_GB2312"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H80000001&
Height = 375
Left = 360
TabIndex = 16
Top = 3600
Width = 375
End
Begin VB.Label Label8
Caption = "(元/天)×出差時間"
BeginProperty Font
Name = "楷體_GB2312"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H80000001&
Height = 375
Left = 1680
TabIndex = 15
Top = 3000
Width = 3735
End
Begin VB.Label Label7
Caption = "+"
BeginProperty Font
Name = "楷體_GB2312"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H80000001&
Height = 375
Left = 360
TabIndex = 14
Top = 3000
Width = 375
End
Begin VB.Label Label6
Caption = "%×特殊加班時間"
BeginProperty Font
Name = "楷體_GB2312"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H80000001&
Height = 375
Left = 2880
TabIndex = 13
Top = 2400
Width = 2295
End
Begin VB.Label Label5
Caption = "+基本工資×"
BeginProperty Font
Name = "楷體_GB2312"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H80000001&
Height = 375
Left = 360
TabIndex = 12
Top = 2400
Width = 1575
End
Begin VB.Label Label4
Caption = "%×正常加班時間"
BeginProperty Font
Name = "楷體_GB2312"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H80000001&
Height = 375
Left = 2880
TabIndex = 11
Top = 1800
Width = 2295
End
Begin VB.Label Label2
Caption = "+基本工資×"
BeginProperty Font
Name = "楷體_GB2312"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H80000001&
Height = 375
Left = 360
TabIndex = 10
Top = 1800
Width = 1575
End
Begin VB.Label Label3
Caption = "員工實際工資="
BeginProperty Font
Name = "楷體_GB2312"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H80000001&
Height = 255
Left = 360
TabIndex = 9
Top = 720
Width = 1935
End
Begin VB.Label Label1
Caption = "基本工資(/每天)×月度正常工作時間"
BeginProperty Font
Name = "楷體_GB2312"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H80000001&
Height = 375
Left = 360
TabIndex = 0
Top = 1200
Width = 4695
End
End
Attribute VB_Name = "frmFormula"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub cmdCancel_Click()
Unload Me
Exit Sub
End Sub
Private Sub cmdDefault_Click() '設置默認值
Me.textAbsent = 50
Me.textErrand = 200
Me.textOvertimeCom = 200
Me.textOvertimeSpe = 400
Me.textLE = 20
Call setValue
End Sub
Private Sub setValue() '添加記錄
Dim sql As String
Dim rs As New ADODB.Recordset
sql = "select * from FormulaSetting"
Set rs = getRS(sql, "Salary")
If rs.EOF = False Then '清除原記錄
sql = "delete from FormulaSetting"
Call TransactSQL(sql, "Salary")
End If
rs.AddNew '添加新記錄
rs.Fields(0) = Me.textOvertimeCom
rs.Fields(1) = Me.textOvertimeSpe
rs.Fields(2) = Me.textErrand
rs.Fields(3) = Me.textAbsent
rs.Fields(4) = Me.textLE
rs.Update
rs.Close
MsgBox "已經設置公式!", vbOKOnly + vbExclamation, "設置結果!"
End Sub
Private Sub init() '初始化
Me.textAbsent = ""
Me.textErrand = ""
Me.textOvertimeCom = ""
Me.textOvertimeSpe = ""
Me.textLE = ""
Me.textOvertimeCom.SetFocus
End Sub
Private Sub cmdOK_Click()
If Me.textOvertimeCom = "" And IsNumeric(Me.textOvertimeCom) = False Then
MsgBox "請輸入正常加班工資百分比!", vbOKOnly + vbExclamation, "提示!"
Me.textOvertimeCom = ""
Me.textOvertimeCom.SetFocus
ElseIf Me.textOvertimeSpe = "" And IsNumeric(Me.textOvertimeSpe) = False Then
MsgBox "請輸入特殊加班工資百分比!", vbOKOnly + vbExclamation, "提示!"
Me.textOvertimeSpe = ""
Me.textOvertimeSpe.SetFocus
ElseIf Me.textErrand = "" And IsNumeric(Me.textErrand) = False Then
MsgBox "請輸入出差工資!", vbOKOnly + vbExclamation, "提示!"
Me.textErrand = ""
Me.textErrand.SetFocus
ElseIf Me.textAbsent = "" And IsNumeric(Me.textAbsent) = False Then
MsgBox "請輸入曠工扣發金額!", vbOKOnly + vbExclamation, "提示!"
Me.textAbsent = ""
Me.textAbsent.SetFocus
ElseIf Me.textLE = "" And IsNumeric(Me.textLE) = False Then
MsgBox "請輸入遲到早退扣發金額!", vbOKOnly + vbExclamation, "提示!"
Me.textLE = ""
Me.textLE.SetFocus
Else
Call setValue
Call init
End If
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -