?? f_jiangli.frm
字號:
_ExtentY = 529
_Version = 393216
CheckBox = -1 'True
DateIsNull = -1 'True
Format = 69402625
CurrentDate = 36189
End
Begin VB.Label Label3
Caption = "款規定"
Height = 255
Left = 6360
TabIndex = 47
Top = 360
Width = 1095
End
Begin VB.Label Label2
Caption = "條第"
Height = 255
Left = 3720
TabIndex = 46
Top = 360
Width = 615
End
Begin VB.Label Label1
Caption = "根據獎懲條例第"
Height = 255
Left = 240
TabIndex = 45
Top = 360
Width = 1455
End
Begin VB.Label lblLabels
Caption = "簽字時間 "
Height = 255
Index = 15
Left = 6360
TabIndex = 44
Top = 4703
Width = 855
End
Begin VB.Label lblLabels
Caption = "總經理"
Height = 255
Index = 14
Left = 6360
TabIndex = 43
Top = 4215
Width = 1095
End
Begin VB.Label lblLabels
Caption = "簽字時間"
Height = 255
Index = 13
Left = 3000
TabIndex = 42
Top = 4703
Width = 855
End
Begin VB.Label lblLabels
Caption = "人力資源部經理"
Height = 255
Index = 12
Left = 3000
TabIndex = 41
Top = 4215
Width = 1335
End
Begin VB.Label lblLabels
Caption = "簽字時間"
Height = 255
Index = 11
Left = 120
TabIndex = 40
Top = 4703
Width = 1215
End
Begin VB.Label lblLabels
Caption = "本部門經理"
Height = 255
Index = 10
Left = 120
TabIndex = 39
Top = 4215
Width = 1095
End
Begin VB.Label lblLabels
Caption = "具體內容"
Height = 255
Index = 9
Left = 240
TabIndex = 38
Top = 2280
Width = 735
End
Begin VB.Label lblLabels
Caption = "性 別"
Height = 255
Index = 8
Left = 3120
TabIndex = 37
Top = 1343
Width = 615
End
Begin VB.Label lblLabels
Caption = "出生日期"
Height = 255
Index = 4
Left = 6360
TabIndex = 36
Top = 1343
Width = 735
End
Begin VB.Label lblLabels
Caption = "獎勵時間"
Height = 255
Index = 7
Left = 3120
TabIndex = 32
Top = 1823
Width = 735
End
Begin VB.Label lblLabels
Caption = "說 明"
Height = 255
Index = 6
Left = 240
TabIndex = 31
Top = 3240
Width = 615
End
Begin VB.Label lblLabels
Caption = "獎勵項目"
Height = 255
Index = 5
Left = 240
TabIndex = 30
Top = 1823
Width = 855
End
Begin VB.Label lblLabels
Caption = "崗 位"
Height = 255
Index = 3
Left = 240
TabIndex = 29
Top = 1343
Width = 735
End
Begin VB.Label lblLabels
Caption = "部 門"
Height = 255
Index = 2
Left = 6360
TabIndex = 28
Top = 855
Width = 615
End
Begin VB.Label lblLabels
Caption = "姓 名"
Height = 255
Index = 1
Left = 3120
TabIndex = 27
Top = 855
Width = 735
End
Begin VB.Label lblLabels
Caption = "員工號 "
Height = 255
Index = 0
Left = 240
TabIndex = 26
Top = 855
Width = 975
End
End
End
End
End
Attribute VB_Name = "F_Jiangli"
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
Private Sub Combo1_KeyPress(KeyAscii As Integer)
If KeyAscii = vbKeyReturn Then
SendKeys "{TAB}"
End If
End Sub
Private Sub DTPicker1_KeyPress(KeyAscii As Integer)
If KeyAscii = vbKeyReturn Then
SendKeys "{TAB}"
End If
End Sub
Private Sub DTPicker2_KeyPress(KeyAscii As Integer)
If KeyAscii = vbKeyReturn Then
SendKeys "{TAB}"
End If
End Sub
Private Sub DTPicker3_KeyPress(KeyAscii As Integer)
If KeyAscii = vbKeyReturn Then
SendKeys "{TAB}"
End If
End Sub
Private Sub DTPicker4_KeyPress(KeyAscii As Integer)
If KeyAscii = vbKeyReturn Then
SendKeys "{TAB}"
End If
End Sub
Private Sub DTPicker5_KeyPress(KeyAscii As Integer)
If KeyAscii = vbKeyReturn Then
SendKeys "{TAB}"
End If
End Sub
Private Sub Form_Load()
'Dim txt As TextBox
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 DTPicker1.DataSource = adoPrimaryRS
Set DTPicker2.DataSource = adoPrimaryRS
Set DTPicker3.DataSource = adoPrimaryRS
Set DTPicker4.DataSource = adoPrimaryRS
Set DTPicker5.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
Combo1.AddItem "獎金"
Combo1.AddItem "旅游"
Combo1.AddItem "表揚"
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
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)
Dim oText As TextBox
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
For Each oText In Me.txtFields
oText.Enabled = Not bVal
Next
DTPicker1.Enabled = Not bVal
DTPicker2.Enabled = Not bVal
DTPicker3.Enabled = Not bVal
DTPicker4.Enabled = Not bVal
DTPicker4.Enabled = Not bVal
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)
Dim Sql3 As String
If Index = 0 Then
Sql3 = "select distinct 部門 ,姓名 ,性別 ,出生日期 ,崗位 from 員工基本信息 where 員工號 = '" & txtFields(0).Text & "'"
Set rs3 = db.Execute(Sql3)
If Not rs3.EOF Then
If Not IsNull(rs3("姓名")) Then
txtFields(1).Text = Trim(rs3("姓名"))
End If
If Not IsNull(rs3("部門")) Then
txtFields(2).Text = Trim(rs3("部門"))
End If
If Not IsNull(rs3("崗位")) Then
txtFields(3).Text = Trim(rs3("崗位"))
End If
If Not IsNull(rs3("性別")) Then
txtFields(7).Text = Trim(rs3("性別"))
End If
If Not IsNull(rs3("出生日期")) Then
DTPicker5.Value = Trim(rs3("出生日期"))
End If
End If
End If
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -