📄 f_renyuanjibenxinxi.frm
字号:
Left = 6000
TabIndex = 71
Top = 600
Width = 735
End
Begin VB.Label lblLabels
Caption = "健康情况:"
Height = 255
Index = 33
Left = 120
TabIndex = 70
Top = 960
Width = 975
End
Begin VB.Label lblLabels
Caption = "特长:"
Height = 255
Index = 62
Left = 120
TabIndex = 69
Top = 2760
Width = 615
End
End
Begin VB.Frame Frame3
Height = 7695
Left = -74880
TabIndex = 10
Top = 360
Width = 8655
Begin MSDataGridLib.DataGrid DataGrid1
Height = 7335
Left = 120
TabIndex = 11
Top = 240
Width = 8415
_ExtentX = 14843
_ExtentY = 12938
_Version = 393216
HeadLines = 1
RowHeight = 14
BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ColumnCount = 2
BeginProperty Column00
DataField = ""
Caption = ""
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
BeginProperty Column01
DataField = ""
Caption = ""
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
SplitCount = 1
BeginProperty Split0
BeginProperty Column00
EndProperty
BeginProperty Column01
EndProperty
EndProperty
End
End
Begin VB.PictureBox Picture1
Appearance = 0 'Flat
BorderStyle = 0 'None
ForeColor = &H80000008&
Height = 300
Left = 2040
ScaleHeight = 300
ScaleWidth = 7080
TabIndex = 2
Top = 7440
Width = 7080
Begin VB.CommandButton CmdAdd
Caption = "增加"
Height = 300
Left = 1080
TabIndex = 9
Top = 0
Width = 1095
End
Begin VB.CommandButton cmdEdit
Caption = "编辑"
Height = 300
Left = 2280
TabIndex = 8
Top = 0
Width = 1095
End
Begin VB.CommandButton CmdDelete
Caption = "删除"
Height = 300
Left = 3480
TabIndex = 7
Top = 0
Width = 1095
End
Begin VB.CommandButton cmdRefresh
Caption = "刷新"
Height = 300
Left = 4680
TabIndex = 6
Top = 0
Width = 1095
End
Begin VB.CommandButton cmdClose
Caption = "关闭"
Height = 300
Left = 5880
TabIndex = 5
Top = 0
Width = 1095
End
Begin VB.CommandButton cmdUpdate
Caption = "保存"
Height = 300
Left = 4680
TabIndex = 4
Top = 0
Visible = 0 'False
Width = 1095
End
Begin VB.CommandButton cmdCancel
Caption = "取消"
Height = 300
Left = 5880
TabIndex = 3
Top = 0
Visible = 0 'False
Width = 1095
End
End
End
End
End
Attribute VB_Name = "F_RenYuanJiBenXinXi"
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 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
Dim oText As TextBox
'Bind the text boxes to the data provider
For Each oText In Me.txtFields
Set oText.DataSource = adoPrimaryRS
Next
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()
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
End Sub
Private Sub txtFields_LostFocus(Index As Integer)
If Not IsNumeric(txtFields(30).Text) And (txtFields(30).Text <> "") Then
MsgBox "请在“身高”中输入数字", vbExclamation + vbOKOnly, pTitle
txtFields(30).SetFocus
txtFields(30).SelLength = Len(txtFields(30))
txtFields(30).SelStart = 0
End If
If Not IsNumeric(txtFields(31).Text) And (txtFields(31).Text <> "") Then
MsgBox "请在“体重”中输入数字", vbExclamation + vbOKOnly, pTitle
txtFields(31).SetFocus
txtFields(31).SelLength = Len(txtFields(31))
txtFields(31).SelStart = 0
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -