sql - 为更新按钮编码时访问 2016 错误 3464
问题描述
在访问 2016 中,我正在尝试使用更新命令。我正在创建一个数据库作为我的实习项目,因为我不熟悉我一直在努力的编码。我指的是 Setha Iech 的视频:https ://www.youtube.com/watch?v=Ri2Y9-16AEo 。当我使用下面的代码时,会不断弹出错误
错误 3464
Private Sub cmdAdd_Click()
'when we click on button Add there are two options
'1. for insert
'2. for update
If Me.txtID.Tag & "" = "" Then
'this is for insert new
'add data to table
CurrentDb.Execute "INSERT INTO Business(ID, Project_ID, [Date_of_Enquiry], Division, Client, Description, Probability_to_win,Status, [Proposal_Submission_date], [Expected_award_date], Remarks)" & _
"VALUES ('" & Me.txtID & "','" & Me.txtProject_ID & "','" & Me.txtDate_of_Enquiry & "','" & Me.cboDivision & "','" & _
Me.txtClient & "','" & Me.txtDescription & "','" & Me.cboProbability_to_win & "','" & Me.cboStatus & "','" & Me.txtProposal_Submission_date & "','" & Me.txtExpected_award_date & "','" & Me.txtRemarks & "')"
Else
'otherwise (Tag of txtID store the ID of statement to be modified)
CurrentDb.Execute "UPDATE Business" & _
" SET ID=" & Me.txtID & _
", Project_ID='" & Me.txtProject_ID & "'" & _
", Date_of_Enquiry='" & Me.txtDate_of_Enquiry & "'" & _
", Division='" & Me.cboDivision & "'" & _
", Client='" & Me.txtClient & "'" & _
", Description='" & Me.txtDescription & "'" & _
", Probability_to_win='" & Me.cboProbability_to_win & "'" & _
", Status='" & Me.cboStatus & "'" & _
", Proposal_Submission_date='" & Me.txtProposal_Submission_date & "'" & _
", Expected_award_date='" & Me.txtExpected_award_date & "'" & _
", Remarks='" & Me.txtRemarks & "'" & _
" WHERE ID=" & Me.txtID.Tag
End If
'clear form
cmdClear_Click
'refresh data in list on form
databasesub.Form.Requery
End Sub
提前感谢您的回答
解决方案
推荐阅读
- r - 当我使用矩阵变量拟合和预测模型时,predic.lm 给出错误数量的预测值
- vue.js - 为什么我无法在 Vue 组件的“已安装”组件上读取 Vuex 存储?
- kubernetes - 按名称查找 pod 时未知主机,通过 pod 重启解决
- excel - 如何以角度绘制excel样式的数据条?
- oracle - 链接到文件服务器 ApEx
- angular - 转到页面选项功能缺少 PrimeNG 分页器
- php - 我想将数据插入到 codigIgnitor 中具有相同 id 的两个表中
- javascript - getElementById 检查是否包含维度
- docker - 与 2 个同行创建组织
- python - 使用 Python 从下载文件夹中删除文件