"John Viescas" <
[email protected]> wrote in message
Hard to guess without seeing the SQL from your query. A simple Select
subquery should not affect updatability.
--
John Viescas, author
"Microsoft Office Access 2003 Inside Out"
"Running Microsoft Access 2000"
"SQL Queries for Mere Mortals"
http://www.viescas.com/
(Microsoft Access MVP since 1993)
news:
[email protected]...
John, here we go:
1. Non-updatable qryPrice SQL with field subquery (Note: I used table
aliases in the field subquery):
SELECT IngredDetailsTable.MenuItemID,
IngredDetailsTable.IngredDetailsID, IngredDetailsTable.IngredID,
IngredTable.IngredDescription, IngredTable.IngredPUPrice,
IngredTable.IngredMCQty, [IngredPUPrice]/[IngredMCQty] AS UnitPrice,
IngredTable.IngredMCUnit, IngredDetailsTable.IngredDetailsQty,
IngredDetailsTable.IngredDetailsUnit, (SELECT
CSng([IngredDetailsQty]*[IngredMCCost]/[UnitScale]) AS
IngredDetailsPrice
FROM (IngredDetailsTable AS IngredDetailsTableA INNER JOIN UnitTable
ON IngredDetailsTableA.IngredDetailsUnit = UnitTable.UnitBase) INNER
JOIN IngredTable AS IngredTableA ON (UnitTable.Unit =
IngredTableA.IngredMCUnit) AND (IngredDetailsTableA.IngredID =
IngredTableA.IngredID)
WHERE (((IngredDetailsTableA.IngredDetailsID)=(IngredDetailsTable.IngredDetailsID)
)))
AS Price
FROM IngredTable INNER JOIN IngredDetailsTable ON IngredTable.IngredID
= IngredDetailsTable.IngredID;
2. Updatable qryPrice SQL with DLookup:
SELECT IngredDetailsTable.MenuItemID,
IngredDetailsTable.IngredDetailsID, IngredDetailsTable.IngredID,
IngredTable.IngredDescription, IngredTable.IngredPUPrice,
IngredTable.IngredMCQty, [IngredPUPrice]/[IngredMCQty] AS UnitPrice,
IngredTable.IngredMCUnit, IngredDetailsTable.IngredDetailsQtyTxt,
IngredDetailsTable.IngredDetailsQty,
IngredDetailsTable.IngredDetailsUnit,
CSng(DLookUp("[IngredDetailsPrice]","qryUnitCnvrt","[IngredDetailsID]
= " & [IngredDetailsID])) AS IngredDetailsPrice
FROM IngredTable INNER JOIN IngredDetailsTable ON IngredTable.IngredID
= IngredDetailsTable.IngredID;
where the qryUnitCnvrt SQL is:
SELECT CSng([IngredDetailsQty]*[IngredMCCost]/[UnitScale]) AS
IngredDetailsPrice, IngredDetailsTable.IngredDetailsID
FROM (IngredDetailsTable INNER JOIN UnitTable ON
IngredDetailsTable.IngredDetailsUnit = UnitTable.UnitBase) INNER JOIN
IngredTable ON (IngredTable.IngredID = IngredDetailsTable.IngredID)
AND (UnitTable.Unit = IngredTable.IngredMCUnit);
Thanks for your help.
Mark