If Text1.Text = "" Or Text2.Text = "" Then
MsgBox "员工编号或名称为空,请重新输入!" Exit Sub End If
If Label1.Caption = "员工档案修改" Then If Adodc1.Recordset.EOF = True Then
MsgBox "编号不存在无法修改", vbOKOnly + vbExclamation, "警告!"
Exit Sub End If
Dim Mag As Integer
Mag = MsgBox("是否修改!", vbYesNo, "警告") If Mag = vbYes Then
Adodc1.Recordset.Delete '删除记录 Else
Exit Sub End If End If
Adodc1.RecordSource = "select * from 员工基本信息表 " Adodc1.Refresh
Adodc1.Recordset.AddNew
Adodc1.Recordset.Fields("员工编号").Value = Val(Text1.Text) Adodc1.Recordset.Fields("姓名").Value = Text2.Text Adodc1.Recordset.Fields("民族").Value = Text3.Text Adodc1.Recordset.Fields("政治面貌").Value = Text4.Text Adodc1.Recordset.Fields("学历").Value = Text5.Text Adodc1.Recordset.Fields("籍贯").Value = Text6.Text Adodc1.Recordset.Fields("籍贯").Value = Text6.Text Adodc1.Recordset.Fields("电话").Value = Text7.Text Adodc1.Recordset.Fields("毕业学校").Value = Text8.Text Adodc1.Recordset.Fields("年龄").Value = Text9.Text Adodc1.Recordset.Fields("职位").Value = Text10.Text
Adodc1.Recordset.Fields("聘用时间").Value = DTPicker1.Value Adodc1.Recordset.Fields("离职时间").Value = DTPicker2.Value Adodc1.Recordset.Fields("性别").Value = Combo1.Text Adodc1.Recordset.Fields("婚姻状况").Value = Combo2.Text Adodc1.Recordset.Fields("所在部门").Value = Combo3.Text Adodc1.Recordset.Update Text1.Text = ""