?? f_jibenxinxi.frm
字號:
TabIndex = 68
Top = 300
Width = 615
End
End
End
End
End
Attribute VB_Name = "F_JiBenXinXi"
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 SqlBuMen As String
Private Sub Combo1_KeyPress(KeyAscii As Integer)
If KeyAscii = vbKeyReturn Then
SendKeys "{TAB}"
End If
End Sub
Private Sub Combo2_KeyPress(KeyAscii As Integer)
If KeyAscii = vbKeyReturn Then
SendKeys "{TAB}"
End If
End Sub
Private Sub Combo3_KeyPress(KeyAscii As Integer)
If KeyAscii = vbKeyReturn Then
SendKeys "{TAB}"
End If
End Sub
Private Sub Combo4_KeyPress(KeyAscii As Integer)
If KeyAscii = vbKeyReturn Then
SendKeys "{TAB}"
End If
End Sub
Private Sub Combo5_KeyPress(KeyAscii As Integer)
If KeyAscii = vbKeyReturn Then
SendKeys "{TAB}"
End If
End Sub
Private Sub Combo6_KeyPress(KeyAscii As Integer)
If KeyAscii = vbKeyReturn Then
SendKeys "{TAB}"
End If
End Sub
Private Sub Combo7_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 DTPicker10_KeyPress(KeyAscii As Integer)
If KeyAscii = vbKeyReturn Then
SendKeys "{TAB}"
End If
End Sub
Private Sub DTPicker11_KeyPress(KeyAscii As Integer)
If KeyAscii = vbKeyReturn Then
SendKeys "{TAB}"
End If
End Sub
Private Sub DTPicker12_KeyPress(KeyAscii As Integer)
If KeyAscii = vbKeyReturn Then
SendKeys "{TAB}"
End If
End Sub
Private Sub DTPicker13_KeyPress(KeyAscii As Integer)
If KeyAscii = vbKeyReturn Then
SendKeys "{TAB}"
End If
End Sub
Private Sub DTPicker14_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 DTPicker6_KeyPress(KeyAscii As Integer)
If KeyAscii = vbKeyReturn Then
SendKeys "{TAB}"
End If
End Sub
Private Sub DTPicker7_KeyPress(KeyAscii As Integer)
If KeyAscii = vbKeyReturn Then
SendKeys "{TAB}"
End If
End Sub
Private Sub DTPicker8_KeyPress(KeyAscii As Integer)
If KeyAscii = vbKeyReturn Then
SendKeys "{TAB}"
End If
End Sub
Private Sub DTPicker9_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
Set DTPicker1.DataSource = adoPrimaryRS
Set DTPicker2.DataSource = adoPrimaryRS
Set DTPicker3.DataSource = adoPrimaryRS
Set DTPicker4.DataSource = adoPrimaryRS
Set DTPicker5.DataSource = adoPrimaryRS
Set DTPicker6.DataSource = adoPrimaryRS
Set DTPicker7.DataSource = adoPrimaryRS
Set DTPicker8.DataSource = adoPrimaryRS
Set DTPicker9.DataSource = adoPrimaryRS
Set DTPicker10.DataSource = adoPrimaryRS
Set DTPicker11.DataSource = adoPrimaryRS
Set DTPicker12.DataSource = adoPrimaryRS
Set DTPicker13.DataSource = adoPrimaryRS
Set DTPicker14.DataSource = adoPrimaryRS
Set Combo1.DataSource = adoPrimaryRS
Set Combo2.DataSource = adoPrimaryRS
Set Combo3.DataSource = adoPrimaryRS
Set Combo4.DataSource = adoPrimaryRS
Set Combo5.DataSource = adoPrimaryRS
Set Combo6.DataSource = adoPrimaryRS
Set Combo7.DataSource = adoPrimaryRS
Dim oText As TextBox
'Bind the text boxes to the data provider
For Each oText In Me.txtFields
Set oText.DataSource = adoPrimaryRS
Next
SqlBuMen = "select distinct 部門名稱 from 部門維護表"
Set RsBuMen = db.Execute(SqlBuMen)
While Not RsBuMen.EOF
Combo1.AddItem Trim(RsBuMen("部門名稱"))
RsBuMen.MoveNext
Wend
Combo2.AddItem "正式工"
Combo2.AddItem "臨時工"
Combo2.AddItem "聘退人員"
Combo3.AddItem "博士"
Combo3.AddItem "碩士"
Combo3.AddItem "大學"
Combo3.AddItem "大專"
Combo3.AddItem "高中"
Combo3.AddItem "職高"
Combo3.AddItem "中技"
Combo3.AddItem "初中"
Combo4.AddItem "男"
Combo4.AddItem "女"
Combo5.AddItem "男"
Combo5.AddItem "女"
Combo6.AddItem "從農村招收"
Combo6.AddItem "從城鎮(zhèn)招收"
Combo6.AddItem "復員轉業(yè)軍人"
Combo6.AddItem "大學中專技校畢業(yè)生"
Combo6.AddItem "本市外單位調入"
Combo6.AddItem "外省自治區(qū)直轄市調入"
Combo6.AddItem "其他"
Combo7.AddItem "工人和學徒"
Combo7.AddItem "工程技術人員"
Combo7.AddItem "管理人員"
Combo7.AddItem "服務人員"
Combo7.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, "系統(tǒng)提示") = 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, "系統(tǒng)提示") = 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 oTEX 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
DTPicker5.Enabled = Not bVal
DTPicker6.Enabled = Not bVal
DTPicker7.Enabled = Not bVal
DTPicker8.Enabled = Not bVal
DTPicker9.Enabled = Not bVal
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -