构建包含SQL UPDATE
语句的字符串时,收到运行时错误2424消息。 Access抱怨其中一个控件或表未被识别。我的直觉告诉我,我的括号或引号有问题。
st_sql = "UPDATE tblCompetency02 INNER JOIN (tblCompetency05 INNER JOIN tblCompetency03 ON tblCompetency05.CompetencyID = tblCompetency03.ID) ON tblCompetency02.ID = tblCompetency03.HighLevelObjective SET tblCompetency05.Checklist = 'YES' WHERE [tblCompetency03].[RoleModelLevel]='self' and [tblCompetency05].[TeamID]= " & Form_frmStaticDataSkills02.TeamID & " and [tblCompetency03].[Order]= " & Form_frmStaticDataSkills02.txtOrder & " and [tblCompetency02].[ID]= " & Form_frmStaticDataSkills02.HLO & ""
Application.DoCmd.RunSQL (st_sql)
Me.TeamID
,Me.txtOrder
和Me.HLO
是文本框控件。
答案 0 :(得分:0)
st_sql = "UPDATE tblCompetency02 INNER JOIN (tblCompetency05 INNER JOIN tblCompetency03 ON tblCompetency05.CompetencyID = tblCompetency03.ID) ON tblCompetency02.ID = tblCompetency03.HighLevelObjective SET tblCompetency05.Checklist = 'YES' WHERE [tblCompetency03].[RoleModelLevel]='self' and [tblCompetency05].[TeamID]= " & Form_frmStaticDataSkills02.TeamID & " and [tblCompetency03].[Order]= " & Form_frmStaticDataSkills02.txtOrder & " and [tblCompetency02].[ID]= " & Form_frmStaticDataSkills02.HLO & ""
Application.DoCmd.RunSQL (st_sql)