S
SAP2
Hello All,
I am trying to update a table using a query. I keep getting "Operation must
use an updateable query". I am not an SQL expert. I just sort of muddle
through. My update query is this:
UPDATE DISTINCTROW CostSummarySheet INNER JOIN qryUpdateTotalUsed3 ON
(CostSummarySheet.CNS_Num = qryUpdateTotalUsed3.CostCNS) AND
(CostSummarySheet.Proj_Num = qryUpdateTotalUsed3.PROJ_NUM) SET
CostSummarySheet.Tot_Used = [qryUpdateTotalUsed3]![SumOf$$]
WHERE (((CostSummarySheet.CNS_Num)=[qryUpdateTotalUsed3].[CostCNS]) AND
((CostSummarySheet.Proj_Num)=[qryUpdateTotalUsed3].[PROJ_NUM]));
I have tried to use DSum to no avail:
UPDATE DISTINCTROW CostSummarySheet INNER JOIN qryUpdateTotalUsed3 ON
(CostSummarySheet.Proj_Num = qryUpdateTotalUsed3.PROJ_NUM) AND
(CostSummarySheet.CNS_Num = qryUpdateTotalUsed3.CostCNS) SET
CostSummarySheet.Tot_Used = DSum("$$","qryUpdateTotalUsed3","PROJ_NUM='" &
qryUpdateTotalUsed3.PROJ_NUM & "' And CostCNS='" & [CostCNS] & "' ")
WHERE (((CostSummarySheet.CNS_Num)=[qryUpdateTotalUsed3].[CostCNS]) AND
((CostSummarySheet.Proj_Num)=[qryUpdateTotalUsed3].[PROJ_NUM]));
My regular Select Query looks like this:
SELECT qryUpdateTotalUsed2.PROJ_NAME, qryUpdateTotalUsed2.PROJ_NUM,
qryUpdateTotalUsed2.CostCNS, Sum(qryUpdateTotalUsed2.[$$]) AS [SumOf$$]
FROM qryUpdateTotalUsed2
GROUP BY qryUpdateTotalUsed2.PROJ_NAME, qryUpdateTotalUsed2.PROJ_NUM,
qryUpdateTotalUsed2.CostCNS
HAVING (((qryUpdateTotalUsed2.PROJ_NAME) Is Not Null));
Is there a way to do what I am asking?
I am trying to avoid "making a table" from the select query as it would ruin
the automatic link with Excel for updating this table (CostSummarySheet).
I am using Access 2003.
Thank you in advance.
I am trying to update a table using a query. I keep getting "Operation must
use an updateable query". I am not an SQL expert. I just sort of muddle
through. My update query is this:
UPDATE DISTINCTROW CostSummarySheet INNER JOIN qryUpdateTotalUsed3 ON
(CostSummarySheet.CNS_Num = qryUpdateTotalUsed3.CostCNS) AND
(CostSummarySheet.Proj_Num = qryUpdateTotalUsed3.PROJ_NUM) SET
CostSummarySheet.Tot_Used = [qryUpdateTotalUsed3]![SumOf$$]
WHERE (((CostSummarySheet.CNS_Num)=[qryUpdateTotalUsed3].[CostCNS]) AND
((CostSummarySheet.Proj_Num)=[qryUpdateTotalUsed3].[PROJ_NUM]));
I have tried to use DSum to no avail:
UPDATE DISTINCTROW CostSummarySheet INNER JOIN qryUpdateTotalUsed3 ON
(CostSummarySheet.Proj_Num = qryUpdateTotalUsed3.PROJ_NUM) AND
(CostSummarySheet.CNS_Num = qryUpdateTotalUsed3.CostCNS) SET
CostSummarySheet.Tot_Used = DSum("$$","qryUpdateTotalUsed3","PROJ_NUM='" &
qryUpdateTotalUsed3.PROJ_NUM & "' And CostCNS='" & [CostCNS] & "' ")
WHERE (((CostSummarySheet.CNS_Num)=[qryUpdateTotalUsed3].[CostCNS]) AND
((CostSummarySheet.Proj_Num)=[qryUpdateTotalUsed3].[PROJ_NUM]));
My regular Select Query looks like this:
SELECT qryUpdateTotalUsed2.PROJ_NAME, qryUpdateTotalUsed2.PROJ_NUM,
qryUpdateTotalUsed2.CostCNS, Sum(qryUpdateTotalUsed2.[$$]) AS [SumOf$$]
FROM qryUpdateTotalUsed2
GROUP BY qryUpdateTotalUsed2.PROJ_NAME, qryUpdateTotalUsed2.PROJ_NUM,
qryUpdateTotalUsed2.CostCNS
HAVING (((qryUpdateTotalUsed2.PROJ_NAME) Is Not Null));
Is there a way to do what I am asking?
I am trying to avoid "making a table" from the select query as it would ruin
the automatic link with Excel for updating this table (CostSummarySheet).
I am using Access 2003.
Thank you in advance.