G
Gary Ayers via AccessMonster.com
I have a form that uses a SQL view as the record source. This view has a
calculated field "ExtPrice" which multiplies the "UnitPrice" by the
"QtyOrd". When I update either the "UnitPrice" or the "QtyOrd" using the
form, the calculated field updates immediately. This is how I want the
form to work...
However, this only works when the SQL view that I use as the record source
contains only one table. I have a requirement to join two additional
tables in this view. When I do this, the form still works but the
calculated field does not update automatically - only by refreshing the
form which is my current workaround.
Any thoughts on how to have the calculated field automatically update
without refreshing the form?
Thanks in advance!
Here is the view:
SELECT TOP 100 PERCENT dbo.tblSubcontractDetail.*,
dbo.tblSubcontractDetail.RorOtherUnitPrice +
dbo.tblSubcontractDetail.RorEvalUnitPrice +
dbo.tblSubcontractDetail.RorRepairUnitPrice AS RorUnitPrice,
(dbo.tblSubcontractDetail.RorOtherUnitPrice +
dbo.tblSubcontractDetail.RorEvalUnitPrice +
dbo.tblSubcontractDetail.RorRepairUnitPrice +
dbo.tblSubcontractDetail.UnitPrice) * dbo.tblSubcontractDetail.QtyOrd AS
ExtPrice
FROM dbo.tblSubcontractNameDetail INNER JOIN dbo.tblSubcontractName ON
dbo.tblSubcontractNameDetail.SubcontractNameID =
dbo.tblSubcontractName.SubcontractNameID INNER JOIN
dbo.tblSubcontractDetail INNER JOIN dbo.tblContractDetail ON
dbo.tblSubcontractDetail.ContractDetailID =
dbo.tblContractDetail.ContractDetailID ON
dbo.tblSubcontractNameDetail.SubcontractNameDetailID =
dbo.tblSubcontractDetail.SubcontractNameDetailID
WHERE dbo.tblSubcontractDetail.SubcontractNameDetailID IN (1413)
ORDER BY dbo.tblContractDetail.Clin, dbo.tblContractDetail.Elin,
dbo.tblSubcontractName.SubcontractName,
dbo.tblSubcontractNameDetail.SubcontractDeliveryOrder,
dbo.tblSubcontractDetail.Slin, dbo.tblSubcontractDetail.PartNumber,
dbo.tblSubcontractDetail.Description
calculated field "ExtPrice" which multiplies the "UnitPrice" by the
"QtyOrd". When I update either the "UnitPrice" or the "QtyOrd" using the
form, the calculated field updates immediately. This is how I want the
form to work...
However, this only works when the SQL view that I use as the record source
contains only one table. I have a requirement to join two additional
tables in this view. When I do this, the form still works but the
calculated field does not update automatically - only by refreshing the
form which is my current workaround.
Any thoughts on how to have the calculated field automatically update
without refreshing the form?
Thanks in advance!
Here is the view:
SELECT TOP 100 PERCENT dbo.tblSubcontractDetail.*,
dbo.tblSubcontractDetail.RorOtherUnitPrice +
dbo.tblSubcontractDetail.RorEvalUnitPrice +
dbo.tblSubcontractDetail.RorRepairUnitPrice AS RorUnitPrice,
(dbo.tblSubcontractDetail.RorOtherUnitPrice +
dbo.tblSubcontractDetail.RorEvalUnitPrice +
dbo.tblSubcontractDetail.RorRepairUnitPrice +
dbo.tblSubcontractDetail.UnitPrice) * dbo.tblSubcontractDetail.QtyOrd AS
ExtPrice
FROM dbo.tblSubcontractNameDetail INNER JOIN dbo.tblSubcontractName ON
dbo.tblSubcontractNameDetail.SubcontractNameID =
dbo.tblSubcontractName.SubcontractNameID INNER JOIN
dbo.tblSubcontractDetail INNER JOIN dbo.tblContractDetail ON
dbo.tblSubcontractDetail.ContractDetailID =
dbo.tblContractDetail.ContractDetailID ON
dbo.tblSubcontractNameDetail.SubcontractNameDetailID =
dbo.tblSubcontractDetail.SubcontractNameDetailID
WHERE dbo.tblSubcontractDetail.SubcontractNameDetailID IN (1413)
ORDER BY dbo.tblContractDetail.Clin, dbo.tblContractDetail.Elin,
dbo.tblSubcontractName.SubcontractName,
dbo.tblSubcontractNameDetail.SubcontractDeliveryOrder,
dbo.tblSubcontractDetail.Slin, dbo.tblSubcontractDetail.PartNumber,
dbo.tblSubcontractDetail.Description