"Not Updateable query" error..

G

Guest

Trying to update a table based on another. Getting messsage "Operation must
use an Updateable query. Anyone see anything wrong with this?

Business unit is on both tables..trying to build/update Master table with
2nd table.

UPDATE BUMasterSpend INNER JOIN BUCatSpendTotal ON
BUMasterSpend.BusinessUnit = BUCatSpendTotal.BusinessUnit SET
BUMasterSpend.HardWareSpend = [BUCatSpendTotal]![SumOfSpend]
WHERE [BUCatSpendTotal]![Category]="Hardware";

Thanks!
 
D

Duane Hookom

Is one side of the join a primary key?
Is either BUMasterSpend or BUCatSpendTotal a totals query? Access doesn't
allow you to edit records in a query that contains a totals query. You might
be able to use a domain aggregate function or a subquery.
 
G

Guest

Yes..BusinessUnit is primary key on BUMasterSpend..BUCatSpendTotal is a
totals query.

Do you mean pull the totals query into the Update query as a subquery?

Thanks,
Don

Duane Hookom said:
Is one side of the join a primary key?
Is either BUMasterSpend or BUCatSpendTotal a totals query? Access doesn't
allow you to edit records in a query that contains a totals query. You might
be able to use a domain aggregate function or a subquery.

--
Duane Hookom
MS Access MVP
--

nycdon said:
Trying to update a table based on another. Getting messsage "Operation
must
use an Updateable query. Anyone see anything wrong with this?

Business unit is on both tables..trying to build/update Master table with
2nd table.

UPDATE BUMasterSpend INNER JOIN BUCatSpendTotal ON
BUMasterSpend.BusinessUnit = BUCatSpendTotal.BusinessUnit SET
BUMasterSpend.HardWareSpend = [BUCatSpendTotal]![SumOfSpend]
WHERE [BUCatSpendTotal]![Category]="Hardware";

Thanks!
 
D

Duane Hookom

Using the Northwind database, this will not work after adding a TotalFreight
field to the Customers table:

UPDATE Customers
SET TotalFreight =
(SELECT SUM(Freight)
FROM Orders
WHERE Orders.CustomerID = Customers.CustomerID);

This did work:

UPDATE Customers
SET TotalFreight =
DSum("Freight","Orders","CustomerID = """ & [CustomerID] & """");

--
Duane Hookom
MS Access MVP
--

nycdon said:
Yes..BusinessUnit is primary key on BUMasterSpend..BUCatSpendTotal is a
totals query.

Do you mean pull the totals query into the Update query as a subquery?

Thanks,
Don

Duane Hookom said:
Is one side of the join a primary key?
Is either BUMasterSpend or BUCatSpendTotal a totals query? Access doesn't
allow you to edit records in a query that contains a totals query. You
might
be able to use a domain aggregate function or a subquery.

--
Duane Hookom
MS Access MVP
--

nycdon said:
Trying to update a table based on another. Getting messsage "Operation
must
use an Updateable query. Anyone see anything wrong with this?

Business unit is on both tables..trying to build/update Master table
with
2nd table.

UPDATE BUMasterSpend INNER JOIN BUCatSpendTotal ON
BUMasterSpend.BusinessUnit = BUCatSpendTotal.BusinessUnit SET
BUMasterSpend.HardWareSpend = [BUCatSpendTotal]![SumOfSpend]
WHERE [BUCatSpendTotal]![Category]="Hardware";

Thanks!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top