I'm trying to create an update query. The update will be based on the QTY, Price, and Unit.
In the code below I've done the first part of the formula. Inside the false section of the IIF statement I need to lookup the value of the Unit in another table then divide the (QTY*Price). The formula is (QTY*Price)/(Unit Multiplier).
So, if the unit is EA (2), then QTY*Price will be divided by 2.
If I did this in excel I would use VLOOKUP. What would I change the code to include the lookup the value in another table? If this operation would be better suited for a vba function, please point me in the direction of some code I could modify to meet my needs.
thanks
In the code below I've done the first part of the formula. Inside the false section of the IIF statement I need to lookup the value of the Unit in another table then divide the (QTY*Price). The formula is (QTY*Price)/(Unit Multiplier).
Code:
UPDATE MasterList_tbl SET MasterList_tbl.[EXTENDED COST (UFC)] = IIf([MasterList_tbl]![QTY]="V","N/A",([MasterList_tbl]![QTY]*[MasterList_tbl]![FY14 AMDF PRICE ]));
So, if the unit is EA (2), then QTY*Price will be divided by 2.
If I did this in excel I would use VLOOKUP. What would I change the code to include the lookup the value in another table? If this operation would be better suited for a vba function, please point me in the direction of some code I could modify to meet my needs.
thanks