I'm trying to build an ordering system in the style of northwind in access 2010 but slightly less complicated! I need to bring the price of the product from the inventory to the order details subform when the product is selected from the combo box, so being a novice my code isn't working properly...
Private Sub Product_AfterUpdate()
Dim PriceX As Currency, UnitX As Currency
PriceX = DLookup("Unit Price", "ProductInventory", "[ProductInventory].[Product]=" & [Product].Value)
UnitX = DLookup("Unit", "ProductInventory", "[Product] =" & [Product].Value)
Unit_Price.Value = PriceX
Unit.Value = UnitX
End Sub