?? f_jibenxinxi.frm
字號:
Width = 855
End
Begin VB.Label lblLabels
Caption = "學(xué)歷:"
Height = 255
Index = 15
Left = 3960
TabIndex = 29
Top = 960
Width = 975
End
Begin VB.Label lblLabels
Caption = "身份證號:"
Height = 255
Index = 14
Left = 120
TabIndex = 27
Top = 2400
Width = 1815
End
Begin VB.Label lblLabels
Caption = "婚姻狀況:"
Height = 255
Index = 13
Left = 7800
TabIndex = 25
Top = 600
Width = 855
End
Begin VB.Label lblLabels
Caption = "政治面目:"
Height = 255
Index = 12
Left = 120
TabIndex = 23
Top = 960
Width = 1815
End
Begin VB.Label lblLabels
Caption = "戶口所在地:"
Height = 255
Index = 11
Left = 7800
TabIndex = 21
Top = 2040
Width = 1215
End
Begin VB.Label lblLabels
Caption = "出生地點:"
Height = 255
Index = 10
Left = 3960
TabIndex = 19
Top = 2040
Width = 1815
End
Begin VB.Label lblLabels
Caption = "籍貫:"
Height = 255
Index = 9
Left = 120
TabIndex = 17
Top = 2040
Width = 615
End
Begin VB.Label lblLabels
Caption = "民族:"
Height = 255
Index = 8
Left = 3960
TabIndex = 15
Top = 600
Width = 615
End
Begin VB.Label lblLabels
Caption = "出生日期:"
Height = 255
Index = 7
Left = 120
TabIndex = 14
Top = 600
Width = 975
End
Begin VB.Label lblLabels
Caption = "血型:"
Height = 255
Index = 5
Left = 120
TabIndex = 12
Top = 1680
Width = 615
End
Begin VB.Label lblLabels
Caption = "體重:"
Height = 255
Index = 4
Left = 7800
TabIndex = 10
Top = 1680
Width = 615
End
Begin VB.Label lblLabels
Caption = "身高:"
Height = 255
Index = 3
Left = 3960
TabIndex = 8
Top = 1680
Width = 615
End
Begin VB.Label lblLabels
Caption = "性別:"
Height = 255
Index = 2
Left = 7800
TabIndex = 7
Top = 240
Width = 615
End
Begin VB.Label lblLabels
Caption = "姓名:"
Height = 255
Index = 1
Left = 3960
TabIndex = 5
Top = 240
Width = 615
End
Begin VB.Label lblLabels
Caption = "員工號:"
Height = 255
Index = 0
Left = 120
TabIndex = 3
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 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 "大學(xué)"
Combo3.AddItem "大專"
Combo3.AddItem "高中"
Combo3.AddItem "職高"
Combo3.AddItem "中技"
Combo3.AddItem "初中"
Combo4.AddItem "男"
Combo4.AddItem "女"
Combo5.AddItem "男"
Combo5.AddItem "女"
Combo6.AddItem "從農(nóng)村招收"
Combo6.AddItem "從城鎮(zhèn)招收"
Combo6.AddItem "復(fù)員轉(zhuǎn)業(yè)軍人"
Combo6.AddItem "大學(xué)中專技校畢業(yè)生"
Combo6.AddItem "本市外單位調(diào)入"
Combo6.AddItem "外省自治區(qū)直轄市調(diào)入"
Combo6.AddItem "其他"
Combo7.AddItem "工人和學(xué)徒"
Combo7.AddItem "工程技術(shù)人員"
Combo7.AddItem "管理人員"
Combo7.AddItem "服務(wù)人員"
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
Exit Sub
AddErr:
MsgBox "增加操作有錯誤", vbExclamation + vbOKOnly, pTitle
End Sub
Private Sub cmdDelete_Click()
On Error GoTo DeleteErr
With adoPrimaryRS
.Delete
.MoveNext
If .EOF Then .MoveLast
End With
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
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
adoPrimaryRS.UpdateBatch adAffectAll
If mbAddNewFlag Then
adoPrimaryRS.MoveLast 'move to the new record
End If
mbEditFlag = False
mbAddNewFlag = False
SetButtons True
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
DTPicker10.Enabled = Not bVal
DTPicker11.Enabled = Not bVal
DTPicker12.Enabled = Not bVal
DTPicker13.Enabled = Not bVal
DTPicker14.Enabled = Not bVal
Combo1.Enabled = Not bVal
Combo2.Enabled = Not bVal
Combo3.Enabled = Not bVal
Combo4.Enabled = Not bVal
Combo5.Enabled = Not bVal
Combo6.Enabled = Not bVal
Combo7.Enabled = Not bVal
End Sub
Private Sub txtFields_LostFocus(Index As Integer)
If Not IsNumeric(txtFields(3).Text) And (txtFields(3).Text <> "") Then
MsgBox "請在“身高”中輸入數(shù)字", vbExclamation + vbOKOnly, pTitle
txtFields(3).SetFocus
txtFields(3).SelLength = Len(txtFields(3))
txtFields(3).SelStart = 0
End If
If Not IsNumeric(txtFields(4).Text) And (txtFields(4).Text <> "") Then
MsgBox "請在“體重”中輸入數(shù)字", vbExclamation + vbOKOnly, pTitle
txtFields(4).SetFocus
txtFields(4).SelLength = Len(txtFields(4))
txtFields(4).SelStart = 0
End If
End Sub
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -