I have 2 tables:
Table1 : PriceList
Table2 : Sale
Table1 contains 2 fields: ProdID and UnitPrice
Table2 contains 1 field: ProductID
Table1:
ProdID------UNitPrice
A----------------1
B----------------2
C----------------3
D----------------4
E----------------5
F----------------6
G----------------7
H----------------8
I----------------9
J----------------10
Table2:
ProdID------UNitPrice
D---------------10
E---------------20
F---------------30
J---------------50
Z---------------60
Expected result in query:
ProdID------UnitSold------UnitPrice---------ExtPrice
D---------------10-------------4---------------$40
E---------------20-------------5---------------$100
F---------------30-------------6---------------$180
J---------------50-------------NA---------------NA
Z---------------60-------------10--------------$600
This is what I have for the DLOOKUP function in the ExtPrice field of the query and it's not working:
UnitPrice: DLookUp("[UnitPrice]","PriceList","UnitPrice=" & [UnitPrice])
Appreciate if someone can point out what I am doing wrong.