Updating Forms

pmagur01

New member
Local time
Today, 22:43
Joined
Nov 5, 2006
Messages
4
can someone tell me how to make a form's data change when related data is changed in another form. E.g. If I change the price of a product in 'products' to £3.00, how do I make it automatically show that it is £3.00 in 'orders' just by typing in the product code?
 
Data is not duplicated in a properly defined relational database. When you wish to obtain data from multiple tables at once, you need to use a query to join the related tables.

Price is a case where in fact, you do want to "duplicate" data. That means that when you add an item to an order, you want to copy the current product price to the order item. This allows the ordered price to remain static even when the product price changes in the future. If you don't do this, you can never properly calculate sales figures by year. Copying the product price from the product table to the order item table is not a violation of normalization principles because price is time based. That means that it can be different over the course of time but in an order, you want the price that was in effect at the time the order was placed/filled. Having the price in the order detail also allows the flexibility, if you need it, to override the price for a particular product for a particular order. For example, if something normally costs $10, you may sell it to a special customer for $9. You couldn't do that if the price existed only in the product table.
 

Users who are viewing this thread

Back
Top Bottom