📄 frmemployee.frm
字号:
VERSION 5.00
Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "mscomct2.ocx"
Begin VB.Form frmAddEmployee
BorderStyle = 1 'Fixed Single
Caption = "Form1"
ClientHeight = 4035
ClientLeft = 45
ClientTop = 330
ClientWidth = 11565
LinkTopic = "Form1"
MaxButton = 0 'False
MDIChild = -1 'True
MinButton = 0 'False
ScaleHeight = 4035
ScaleWidth = 11565
Begin VB.Frame Frame2
Caption = "员工基本信息"
Height = 2895
Left = 120
TabIndex = 2
Top = 240
Width = 11295
Begin VB.TextBox txtDepartment
DataField = "民族"
Height = 285
Left = 5520
TabIndex = 38
Top = 1560
Width = 1935
End
Begin VB.TextBox txtDegree
DataField = "民族"
Height = 285
Left = 5520
TabIndex = 37
Top = 1200
Width = 1935
End
Begin VB.TextBox txtSex
DataField = "民族"
Height = 285
Left = 9120
TabIndex = 36
Top = 480
Width = 1935
End
Begin VB.TextBox txtPosition
DataField = "岗位"
Height = 285
Left = 9120
TabIndex = 14
Top = 1560
Width = 1935
End
Begin VB.TextBox txtTel
DataField = "电话"
Height = 285
Left = 1920
TabIndex = 13
Top = 2400
Width = 1935
End
Begin VB.TextBox txtZip
DataField = "邮编"
Height = 285
Left = 9120
TabIndex = 12
Top = 2400
Width = 1935
End
Begin VB.TextBox txtAddress
DataField = "家庭通讯地址"
Height = 285
Left = 5520
TabIndex = 11
Top = 2400
Width = 1935
End
Begin VB.TextBox txtID
DataField = "身份证号"
Height = 285
Left = 9120
TabIndex = 10
Top = 1920
Width = 1935
End
Begin VB.TextBox txtMarriage
DataField = "婚姻状况"
Height = 285
Left = 9120
TabIndex = 9
Top = 840
Width = 1935
End
Begin VB.TextBox txtStatus
DataField = "政治面目"
Height = 285
Left = 1920
TabIndex = 8
Top = 1200
Width = 1935
End
Begin VB.TextBox txtLivingPlace
DataField = "户口所在地"
Height = 285
Left = 5520
TabIndex = 7
Top = 1920
Width = 1935
End
Begin VB.TextBox txtHomeTown
DataField = "籍贯"
Height = 285
Left = 1920
TabIndex = 6
Top = 1920
Width = 1935
End
Begin VB.TextBox txtNation
DataField = "民族"
Height = 285
Left = 5520
TabIndex = 5
Top = 840
Width = 1935
End
Begin VB.TextBox txtName
DataField = "姓名"
Height = 285
Left = 5520
TabIndex = 4
Top = 480
Width = 1935
End
Begin VB.TextBox txtEmployeeID
DataField = "员工号"
Height = 285
Left = 1920
TabIndex = 3
Top = 480
Width = 1935
End
Begin MSComCtl2.DTPicker DTForm
DataField = "转正时间"
Height = 300
Left = 1920
TabIndex = 15
Top = 1560
Width = 1935
_ExtentX = 3413
_ExtentY = 529
_Version = 393216
CheckBox = -1 'True
DateIsNull = -1 'True
Format = 72220673
CurrentDate = 36195
End
Begin MSComCtl2.DTPicker DTEnterCom
DataField = "进入公司时间"
Height = 300
Left = 9120
TabIndex = 16
Top = 1200
Width = 1935
_ExtentX = 3413
_ExtentY = 529
_Version = 393216
CheckBox = -1 'True
DateIsNull = -1 'True
Format = 72220673
CurrentDate = 36191
End
Begin MSComCtl2.DTPicker DTBirth
DataField = "出生日期"
Height = 300
Left = 1920
TabIndex = 17
Top = 840
Width = 1935
_ExtentX = 3413
_ExtentY = 529
_Version = 393216
CheckBox = -1 'True
DateIsNull = -1 'True
Format = 72220673
CurrentDate = 36191
End
Begin VB.Label Label4
Caption = "*"
Height = 255
Left = 5280
TabIndex = 42
Top = 480
Width = 135
End
Begin VB.Label Label3
Caption = "*"
Height = 255
Left = 8880
TabIndex = 41
Top = 2040
Width = 135
End
Begin VB.Label Label2
Caption = "*"
Height = 255
Left = 1680
TabIndex = 40
Top = 480
Width = 135
End
Begin VB.Label lblLabels
Caption = "部门:"
Height = 255
Index = 57
Left = 4440
TabIndex = 35
Top = 1560
Width = 855
End
Begin VB.Label lblLabels
Caption = "岗位:"
Height = 255
Index = 56
Left = 8280
TabIndex = 34
Top = 1560
Width = 735
End
Begin VB.Label lblLabels
Caption = "电话:"
Height = 255
Index = 29
Left = 720
TabIndex = 33
Top = 2520
Width = 495
End
Begin VB.Label lblLabels
Caption = "邮编:"
Height = 255
Index = 28
Left = 8280
TabIndex = 32
Top = 2400
Width = 615
End
Begin VB.Label lblLabels
Caption = "家庭通讯地址:"
Height = 255
Index = 27
Left = 3960
TabIndex = 31
Top = 2400
Width = 1215
End
Begin VB.Label lblLabels
Caption = "转正时间:"
Height = 255
Index = 48
Left = 360
TabIndex = 30
Top = 1560
Width = 1815
End
Begin VB.Label lblLabels
Caption = "进入公司时间:"
Height = 255
Index = 47
Left = 7560
TabIndex = 29
Top = 1200
Width = 1335
End
Begin VB.Label lblLabels
Caption = "学历:"
Height = 255
Index = 15
Left = 4440
TabIndex = 28
Top = 1200
Width = 975
End
Begin VB.Label lblLabels
Caption = "身份证号:"
Height = 255
Index = 14
Left = 7920
TabIndex = 27
Top = 2040
Width = 1095
End
Begin VB.Label lblLabels
Caption = "婚姻状况:"
Height = 255
Index = 13
Left = 7920
TabIndex = 26
Top = 840
Width = 855
End
Begin VB.Label lblLabels
Caption = "政治面目:"
Height = 255
Index = 12
Left = 360
TabIndex = 25
Top = 1200
Width = 1815
End
Begin VB.Label lblLabels
Caption = "户口所在地:"
Height = 255
Index = 11
Left = 3960
TabIndex = 24
Top = 1920
Width = 1215
End
Begin VB.Label lblLabels
Caption = "籍贯:"
Height = 255
Index = 9
Left = 720
TabIndex = 23
Top = 2040
Width = 615
End
Begin VB.Label lblLabels
Caption = "民族:"
Height = 255
Index = 8
Left = 4440
TabIndex = 22
Top = 840
Width = 615
End
Begin VB.Label lblLabels
Caption = "出生日期:"
Height = 255
Index = 7
Left = 360
TabIndex = 21
Top = 840
Width = 975
End
Begin VB.Label lblLabels
Caption = "性别:"
Height = 255
Index = 2
Left = 8280
TabIndex = 20
Top = 480
Width = 615
End
Begin VB.Label lblLabels
Caption = "姓名:"
Height = 255
Index = 1
Left = 4440
TabIndex = 19
Top = 480
Width = 615
End
Begin VB.Label lblLabels
Caption = "员工号:"
Height = 255
Index = 0
Left = 480
TabIndex = 18
Top = 480
Width = 735
End
End
Begin VB.CommandButton cmdExit
Caption = "退出"
Height = 375
Left = 8040
TabIndex = 1
Top = 3480
Width = 1095
End
Begin VB.CommandButton cmdSave
Caption = "保存"
Height = 375
Left = 2400
TabIndex = 0
Top = 3480
Width = 1095
End
Begin VB.Label Label1
Caption = "Label1"
Height = 495
Left = 5160
TabIndex = 39
Top = 2760
Width = 1215
End
End
Attribute VB_Name = "frmAddEmployee"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub cmdExit_Click()
Unload Me
End Sub
Private Sub cmdSave_Click()
Dim txtSQL As String
Dim MsgText As String
Dim mrcc As ADODB.Recordset
If Not Testtxt(txtEmployeeID.Text) Then
MsgBox "请输入员工号!", vbOKOnly + vbExclamation, "警告"
txtEmployeeID.SetFocus
Exit Sub
End If
If Not Testtxt(txtName.Text) Then
MsgBox "请输入姓名!", vbOKOnly + vbExclamation, "警告"
txtName.SetFocus
Exit Sub
End If
If Not IsNumeric(txtID.Text) Then
MsgBox "请输入身份证号!", vbOKOnly + vbExclamation, "警告"
txtID.SetFocus
Exit Sub
End If
txtSQL = "select * from 员工信息 where 员工号= '" & Trim(txtEmployeeID.Text) & "'"
Set mrcc = ExecuteSQL(txtSQL, MsgText)
If mrcc.EOF = False Then
MsgBox "员工号重复,请重新输入!", vbOKOnly + vbExclamation, "警告"
mrcc.Close
txtEmployeeID.SetFocus
Else
mrcc.AddNew
mrcc.Fields(0) = Trim(txtEmployeeID.Text)
mrcc.Fields(1) = Trim(txtName.Text)
mrcc.Fields(2) = Trim(txtSex.Text)
mrcc.Fields(3) = DTBirth.Value
mrcc.Fields(4) = Trim(txtNation.Text)
mrcc.Fields(5) = Trim(txtMarriage.Text)
mrcc.Fields(6) = Trim(txtStatus.Text)
mrcc.Fields(7) = Trim(txtDegree.Text)
mrcc.Fields(8) = Trim(DTEnterCom.Value)
mrcc.Fields(9) = Trim(DTForm.Value)
mrcc.Fields(10) = Trim(txtDepartment.Text)
mrcc.Fields(11) = Trim(txtPosition.Text)
mrcc.Fields(12) = Trim(txtHomeTown.Text)
mrcc.Fields(13) = Trim(txtLivingPlace.Text)
mrcc.Fields(14) = Trim(txtID.Text)
mrcc.Fields(15) = Trim(txtAddress.Text)
mrcc.Fields(16) = Trim(txtZip.Text)
mrcc.Fields(17) = Trim(txtTel.Text)
mrcc.Update
MsgBox "员工信息添加成功!", vbOKOnly + vbExclamation, "添加房屋资料信息"
mrcc.Close
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -