When I ran the following function I got the error message “Operation must use an updateable query.”:
Public Function UpdProjNLA()
NLA_SQL = _
"UPDATE Project " & _
"SET Project.projNLA_area = " & _
"(SELECT Sum(Floor.formalVSml_no * Floor.nla) " & _
"FROM Floor WHERE Floor.proj_id = txtproj_id) " & _
"WHERE project.proj_id = txtproj_id;"
DoCmd.RunSQL NLA_SQL
End Function
I got the same error message when I tried to run the SQL query in SQLView.
If I tried to run this query as 2 separate queries (i.e. the inner select query, then an update query) , they work fine.
Background information:
1) the above function is attached to a Save button on a form
2) txtproj_id is a text box from the form.
3) The Project table and Floor table are joined by the proj_id field.
Would someone be able to assist on where the issue is and how to fix it?
Public Function UpdProjNLA()
NLA_SQL = _
"UPDATE Project " & _
"SET Project.projNLA_area = " & _
"(SELECT Sum(Floor.formalVSml_no * Floor.nla) " & _
"FROM Floor WHERE Floor.proj_id = txtproj_id) " & _
"WHERE project.proj_id = txtproj_id;"
DoCmd.RunSQL NLA_SQL
End Function
I got the same error message when I tried to run the SQL query in SQLView.
If I tried to run this query as 2 separate queries (i.e. the inner select query, then an update query) , they work fine.
Background information:
1) the above function is attached to a Save button on a form
2) txtproj_id is a text box from the form.
3) The Project table and Floor table are joined by the proj_id field.
Would someone be able to assist on where the issue is and how to fix it?