Good morning all,
I have a query that returns
DeptCode TotalRepairs
IA702 500
MA702 700
etc.
query name is getTotals
I need to update an existing table with this data depending on the month chosen from a drop down box.
Table
DeptCode January February March etc
IA702 350 400 0
MA702 100 250 0
Table name is yearCostRecord
I'll probably use DoCmd.RunSQL to execute it once it's built so I can capture the month variable. I just don't know how to write the query. This was my try but it fails.
UPDATE yearCostRecord SET yearCostRecord.March = 500
WHERE (((yearCostRecord.DeptCode)=[getTotals].[DeptCode]));
I was just using a generic month and total value to test....
Any suggestions on how to correctly run this update??
Thanks everyone.
PB
I have a query that returns
DeptCode TotalRepairs
IA702 500
MA702 700
etc.
query name is getTotals
I need to update an existing table with this data depending on the month chosen from a drop down box.
Table
DeptCode January February March etc
IA702 350 400 0
MA702 100 250 0
Table name is yearCostRecord
I'll probably use DoCmd.RunSQL to execute it once it's built so I can capture the month variable. I just don't know how to write the query. This was my try but it fails.
UPDATE yearCostRecord SET yearCostRecord.March = 500
WHERE (((yearCostRecord.DeptCode)=[getTotals].[DeptCode]));
I was just using a generic month and total value to test....
Any suggestions on how to correctly run this update??
Thanks everyone.
PB