I have two queries that updates currency
one to update the PRamt and other to update the VoucherAmt.
User fills out a Purchase Requisition form and at first by defaut, check "chkEST" is selected.
PRamount then would be updated /w Qry_PrAmt.
when user updates this form and checks "chkActual"(est will be set to no),
then VoucherAmt needs to be updated.
here are my sql codings
UPDATE tbl_BudMaster AS B INNER JOIN tbl_PurchaseRequisition AS V ON B.BudgetKey = V.BudgetKey SET B.PrAmt = nz(DSum("Amount","tbl_PurchaseRequisition","BudgetKey='" & B.BudgetKey & "'"),0)
WHERE (((V.Actual)=No));
and
UPDATE (tbl_BudMaster AS B INNER JOIN tbl_Vregister AS V ON B.BudgetKey = V.BudgetKey) INNER JOIN tbl_purchaseRequisition ON (B.BudgetKey = tbl_purchaseRequisition.BudgetKey) AND (V.PrNum = tbl_purchaseRequisition.PrNum) SET B.VoucherAmt = nz(DSum("budgetamt","tbl_Vregister","BudgetKey='" & B.BudgetKey & "'"),0)
WHERE (((V.DocNum)="N") AND ((tbl_purchaseRequisition.Actual)=Yes));
eventhough record is being changed from est to actual,
prAmt remains the same.
if no records is true where actual=no then shouldn't it
return 0? instead of previous record still there?
.
one to update the PRamt and other to update the VoucherAmt.
User fills out a Purchase Requisition form and at first by defaut, check "chkEST" is selected.
PRamount then would be updated /w Qry_PrAmt.
when user updates this form and checks "chkActual"(est will be set to no),
then VoucherAmt needs to be updated.
here are my sql codings
UPDATE tbl_BudMaster AS B INNER JOIN tbl_PurchaseRequisition AS V ON B.BudgetKey = V.BudgetKey SET B.PrAmt = nz(DSum("Amount","tbl_PurchaseRequisition","BudgetKey='" & B.BudgetKey & "'"),0)
WHERE (((V.Actual)=No));
and
UPDATE (tbl_BudMaster AS B INNER JOIN tbl_Vregister AS V ON B.BudgetKey = V.BudgetKey) INNER JOIN tbl_purchaseRequisition ON (B.BudgetKey = tbl_purchaseRequisition.BudgetKey) AND (V.PrNum = tbl_purchaseRequisition.PrNum) SET B.VoucherAmt = nz(DSum("budgetamt","tbl_Vregister","BudgetKey='" & B.BudgetKey & "'"),0)
WHERE (((V.DocNum)="N") AND ((tbl_purchaseRequisition.Actual)=Yes));
eventhough record is being changed from est to actual,
prAmt remains the same.
if no records is true where actual=no then shouldn't it
return 0? instead of previous record still there?
.