|
5#
楼主 |
发表于 2006-4-15 20:00:00
|
只看该作者
Private Sub 保存1_Click()
Dim STemp As String
If 姓名c.Value = "" Then
MsgBox "“姓名”不能为空,请重新输入!", vbInformation, "警告"
姓名c.SetFocus
Else
If IDc.Value = "" Then
STemp = "INSERT INTO 员工信息 (工号,姓名,职位,岗位,班组,入职日期,转正日期,离职日期,电话1,电话2,电话3,[ID card],状态) VALUES ('' & Employee_ID & '','" & 姓名c & "','" & 职位c & "' ,'" & 岗位c & "','" & 班组c & "' ,'# & 入职日期c & #','# & 转正日期c & #','# & 离职日期c & #' ,'" & Telephone_1c & "' ,'" & Telephone_2c & "','" & Telephone_3c & "','" & ID_cardc & "' ,'" & 状态c & "')"
Else
STemp = "update 员工信息 set 工号='' & Employee_ID & '',姓名='" & 姓名c & "',职位='" & 职位c & "',岗位='" & 岗位c & "',班组='" & 班组c & "',入职日期='# & 入职日期c & #',转正日期='# & 转正日期c & #',离职日期='# & Me.离职日期c & #',电话1='" & Telephone_1c & "',电话2='" & Telephone_2c & "',电话3='" & Telephone_3c & "',[ID card]='" & ID_cardc & "',状态='" & 状态 & "' where ID=" & IDc.Value
End If
If MsgBox("真的要保存吗?", vbYesNo, "确认") = vbYes Then
DoCmd.SetWarnings 0
DoCmd.RunSQL STemp
DoCmd.SetWarnings 1
End If
上一个1.Enabled = True
下一个1.Enabled = True
添加1.Enabled = True
修改1.Enabled = True
修改1.Caption = "修改"
修改1.ForeColor = 10040115
Form.Requery
Form.AllowEdits = False
IDc.Value = Me!ID.Value
Employee_ID.Value = Me.工号.Value
姓名c.Value = Me.姓名.Value
职位c.Value = Me.职位.Value
岗位c.Value = Me.岗位.Value
班组c.Value = Me.班组.Value
入职日期c.Value = Me.入职日期.Value
转正日期c.Value = Me.转正日期.Value
离职日期c.Value = Me.离职日期.Value
Telephone_1c.Value = Me.电话1.Value
Telephone_2c.Value = Me.电话2.Value
Telephone_3c.Value = Me.电话3.Value
ID_cardc.Value = Me.[ID card].Value
状态c.Value = Me.状态.Value
姓名查询c.Requery
End If
End Sub 哪位高手能不能帮我看看这里哪里出错了,为什么我总是保存不了,可是系统也没有显示我出错!!!谢谢啦~~~~急 |
|