I have these tables:
- tblOrders ('OrderId', 'Date', 'Client')
- tblOrderDetails ('Id', 'OrderId', 'Product', 'Qty', 'Price')
- tblPriceList ('PriceId', 'From Date', 'To Date', 'Client', 'Product, 'Price')
I have made a form based on tblOrders where the user can enter: 'Date' and 'Client'.
Then i made a subform based on tblOrderDetails where the user enter: 'Product' and 'Qty' for each order line.
Now i need to display each 'Price' next to 'Qty', that depends on the 'Product', 'Client' and 'Date' of the Order line, as the tblPriceList indicate.
Also when i change the client or date in the form i need these 'Price' values to be automatically updated in the form and also in the table tblOrderDetails.
I managed to create a query joining these 3 tables, but then i was unable to create a new recordset in the form because of it complex relationship.
I also tried by creating a textbox in the tblOrderDetails subform with a Dlookup that gets the correct 'Price' from the tblPricelist for each order line. But then i didn't find a way to store this values in the 'Price' field from tblOrderDetails.
Is there any way to resolve this? Maybe a change in the database design?
tblOrderDetailsand determ the Price in a query field by joiningtblOrderDetailswithtblOrdersonOrderIDthen jointblPricelistontblOrders.OrderID,tblOrders.ClientandtblOrderDetails.Productto get matchting Price. - ComputerVersteher