|
大家好
我是access新手
现想请大家帮我看看下面这段代码哪里出错了
谢谢
- Private Sub 保存信息_Click()
- On Error GoTo Err_保存信息_Click:
- Dim Stemp As String
- If Me![职员ID] <> "" Then
- Stemp = "insert into 职员内部调动"
- Stemp = Stemp & "(职员ID,姓名,性别,原部门,新部门,调动日期,调动原因,备注)"
- Stemp = Stemp & "values('" & Me![职员ID] & "','" & Me![姓名] & "',"
- Stemp = Stemp & "'" & Me![性别] & "'," & Me![原部门] & "',"
- Stemp = Stemp & "'" & Me![新部门] & "'," & Me![调动日期] & "',"
- Stemp = Stemp & "'" & Me![调动原因] & "'," & Me![备注] & "')"
- DoCmd.RunSQL Stemp
- Stemp = "update 职员基本资料"
- Stemp = Stemp & "set 部门ID='" & Me![新部门ID] & "'"
- Stemp = Stemp & "where 职员ID='" & Me![职员ID] & "'"
- DoCmd.RunSQL Stemp
- Else
- MsgBox "'职员ID'不能为空,请重新输入!", vbOKOnly, "警告"
- Me![职员ID].SetFocus
- End If
- Me![职员内部调动管理子窗体].Requery
- exit_保存信息_click:
- Exit Sub
- Err_保存信息_Click:
- MsgBox Err.Description
- Resume exit_保存信息_click
- End Sub
复制代码
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
x
|