?? f_yanglaojiaofei.frm
字號:
End
Begin VB.Label lblLabels
Caption = "個人繳納"
Height = 255
Index = 12
Left = 360
TabIndex = 31
Top = 3480
Width = 975
End
Begin VB.Label lblLabels
Caption = "劃入帳戶"
Height = 255
Index = 11
Left = 4320
TabIndex = 30
Top = 2880
Width = 975
End
Begin VB.Label lblLabels
Caption = "個人帳戶金額小計"
Height = 255
Index = 10
Left = 4320
TabIndex = 29
Top = 3480
Width = 1575
End
Begin VB.Label lblLabels
Caption = "統籌基金"
Height = 255
Index = 9
Left = 360
TabIndex = 28
Top = 2880
Width = 1095
End
Begin VB.Label lblLabels
Caption = "職工月繳費基數"
Height = 255
Index = 8
Left = 4320
TabIndex = 27
Top = 2280
Width = 1335
End
Begin VB.Label lblLabels
Caption = "月 數"
Height = 255
Index = 7
Left = 360
TabIndex = 26
Top = 2280
Width = 1095
End
Begin VB.Label lblLabels
Caption = "繳費結束時間"
Height = 255
Index = 6
Left = 4320
TabIndex = 25
Top = 1680
Width = 1215
End
Begin VB.Label lblLabels
Caption = "繳費開始時間"
Height = 255
Index = 5
Left = 360
TabIndex = 24
Top = 1680
Width = 1215
End
Begin VB.Label lblLabels
Caption = "姓 名"
Height = 255
Index = 3
Left = 4320
TabIndex = 23
Top = 480
Width = 1095
End
Begin VB.Label lblLabels
Caption = "員工號"
Height = 255
Index = 2
Left = 360
TabIndex = 22
Top = 480
Width = 1095
End
Begin VB.Label lblLabels
Caption = "社會保障號碼"
Height = 255
Index = 1
Left = 4320
TabIndex = 21
Top = 1080
Width = 1215
End
Begin VB.Label lblLabels
Caption = "電腦序號"
Height = 255
Index = 0
Left = 360
TabIndex = 20
Top = 1080
Width = 1095
End
End
End
End
End
Attribute VB_Name = "F_YangLaoJiaoFei"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim WithEvents adoPrimaryRS As Recordset
Attribute adoPrimaryRS.VB_VarHelpID = -1
Dim mvBookMark As Variant
Dim mbEditFlag As Boolean
Dim mbAddNewFlag As Boolean
'統籌基金比例
Dim tcjj As Double
'劃入帳戶比例
Dim hrzh As Double
'個人繳納比例
Dim grjn As Double
Private Sub DTPicker1_KeyPress(KeyAscii As Integer)
If KeyAscii = vbKeyReturn Then
SendKeys "{TAB}"
End If
End Sub
Private Sub DTPicker2_Change()
Dim Sql3 As String
If DTPicker2.Value <> "" Then
Sql3 = "select distinct 統籌基金比例 ,劃入帳戶比例 ,個人繳納比例 from 養老保險公司比例 where 年度 = " & Year(DTPicker2.Value)
Set rs3 = db.Execute(Sql3)
If Not rs3.EOF Then
If Not IsNull(rs3("統籌基金比例")) Then
tcjj = Trim(rs3("統籌基金比例")) / 100
End If
If Not IsNull(rs3("劃入帳戶比例")) Then
hrzh = Trim(rs3("劃入帳戶比例")) / 100
End If
If Not IsNull(rs3("個人繳納比例")) Then
grjn = Trim(rs3("個人繳納比例")) / 100
End If
If IsNumeric(txtFields(7)) And IsNumeric(txtFields(8)) Then
txtFields(9) = CDbl(txtFields(7)) * CDbl(txtFields(8)) * tcjj
txtFields(11) = CDbl(txtFields(7)) * CDbl(txtFields(8)) * hrzh
txtFields(12) = CDbl(txtFields(7)) * CDbl(txtFields(8)) * grjn
txtFields(10) = CDbl(txtFields(11)) + CDbl(txtFields(12))
End If
Else
MsgBox "公司比例中沒有此年的記錄,請輸入后再進行繳費記錄的填寫!"
End If
End If
End Sub
Private Sub DTPicker2_KeyPress(KeyAscii As Integer)
If KeyAscii = vbKeyReturn Then
SendKeys "{TAB}"
End If
End Sub
Private Sub Form_Load()
On Error Resume Next
For Each TextBox In Me.Controls
TextBox.Font.Name = "宋體"
TextBox.Font.Size = 9
Next
Set adoPrimaryRS = New Recordset
adoPrimaryRS.Open "select * from 養老保險繳費情況表", db, adOpenStatic, adLockOptimistic
Set DataGrid1.DataSource = adoPrimaryRS
SetButtons True
Dim oText As TextBox
'Bind the text boxes to the data provider
For Each oText In Me.txtFields
Set oText.DataSource = adoPrimaryRS
Next
Set DTPicker1.DataSource = adoPrimaryRS
Set DTPicker2.DataSource = adoPrimaryRS
End Sub
Private Sub Form_Unload(Cancel As Integer)
Screen.MousePointer = vbDefault
End Sub
Private Sub cmdAdd_Click()
On Error GoTo AddErr
With adoPrimaryRS
If Not (.BOF And .EOF) Then
mvBookMark = .Bookmark
End If
.AddNew
mbAddNewFlag = True
SetButtons False
End With
On Error GoTo 0
Exit Sub
AddErr:
MsgBox "增加操作有錯誤", vbExclamation + vbOKOnly, pTitle
End Sub
Private Sub cmdDelete_Click()
On Error GoTo DeleteErr
If MsgBox("確認是否刪除此記錄信息?", vbYesNo + vbQuestion, "系統提示") = vbNo Then Exit Sub
With adoPrimaryRS
.Delete
.MoveNext
If .EOF Then .MoveLast
End With
On Error GoTo 0
Exit Sub
DeleteErr:
MsgBox "刪除操作有錯誤", vbExclamation + vbOKOnly, pTitle
End Sub
Private Sub cmdRefresh_Click()
'This is only needed for multi user apps
On Error GoTo RefreshErr
adoPrimaryRS.Requery
On Error GoTo 0
Exit Sub
RefreshErr:
MsgBox "刷新操作有錯誤", vbExclamation + vbOKOnly, pTitle
End Sub
Private Sub cmdEdit_Click()
On Error GoTo EditErr
mbEditFlag = True
SetButtons False
On Error GoTo 0
Exit Sub
EditErr:
MsgBox "更改操作有錯誤", vbExclamation + vbOKOnly, pTitle
End Sub
Private Sub cmdCancel_Click()
' On Error Resume Next
On Error GoTo CancelErr
mbEditFlag = False
mbAddNewFlag = False
adoPrimaryRS.CancelUpdate
If mvBookMark > 0 Then
adoPrimaryRS.Bookmark = mvBookMark
Else
adoPrimaryRS.MoveFirst
End If
SetButtons True
Exit Sub
CancelErr:
MsgBox "取消操作有錯誤", vbExclamation + vbOKOnly, pTitle
End Sub
Private Sub cmdUpdate_Click()
On Error GoTo UpdateErr
If MsgBox("是否確認此操作?", vbYesNo + vbQuestion, "系統提示") = vbNo Then Exit Sub
adoPrimaryRS.UpdateBatch adAffectAll
If mbAddNewFlag Then
adoPrimaryRS.MoveLast 'move to the new record
End If
mbEditFlag = False
mbAddNewFlag = False
SetButtons True
On Error GoTo 0
Exit Sub
UpdateErr:
MsgBox "保存操作有錯誤", vbExclamation + vbOKOnly, pTitle
End Sub
Private Sub cmdClose_Click()
RSGL.Enabled = True
Unload Me
End Sub
Private Sub SetButtons(bVal As Boolean)
CmdAdd.Visible = bVal
cmdEdit.Visible = bVal
cmdUpdate.Visible = Not bVal
cmdCancel.Visible = Not bVal
CmdDelete.Visible = bVal
cmdClose.Visible = bVal
cmdRefresh.Visible = bVal
If bVal Then
Set DataGrid1.DataSource = adoPrimaryRS
Else
Set DataGrid1.DataSource = Nothing
End If
txtFields(0).Enabled = Not bVal
txtFields(1).Enabled = Not bVal
txtFields(2).Enabled = Not bVal
txtFields(3).Enabled = Not bVal
txtFields(7).Enabled = Not bVal
txtFields(8).Enabled = Not bVal
DTPicker1.Enabled = Not bVal
DTPicker2.Enabled = Not bVal
End Sub
Private Sub txtFields_Change(Index As Integer)
If IsNumeric(txtFields(7)) And IsNumeric(txtFields(8)) Then
txtFields(9) = CDbl(txtFields(7)) * CDbl(txtFields(8)) * tcjj
txtFields(11) = CDbl(txtFields(7)) * CDbl(txtFields(8)) * hrzh
txtFields(12) = CDbl(txtFields(7)) * CDbl(txtFields(8)) * grjn
txtFields(10) = CDbl(txtFields(11)) + CDbl(txtFields(12))
End If
End Sub
Private Sub txtFields_KeyPress(Index As Integer, KeyAscii As Integer)
If KeyAscii = vbKeyReturn Then
SendKeys "{TAB}"
End If
End Sub
Private Sub txtFields_LostFocus(Index As Integer)
If Not IsNumeric(txtFields(7).Text) And (txtFields(7).Text <> "") Then
MsgBox "請在“月數”中輸入數字", vbExclamation + vbOKOnly, pTitle
txtFields(7).SetFocus
txtFields(7).SelLength = Len(txtFields(7))
txtFields(7).SelStart = 0
End If
If Not IsNumeric(txtFields(8).Text) And (txtFields(8).Text <> "") Then
MsgBox "請在“職工月繳費基數”中輸入數字", vbExclamation + vbOKOnly, pTitle
txtFields(8).SetFocus
txtFields(8).SelLength = Len(txtFields(8))
txtFields(8).SelStart = 0
End If
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -