Mariano Posted December 28, 2005 Posted December 28, 2005 I have a project that I am working on for placing Purchase orders. One Table is named Purchase Orders, another is Item Master, and the third is Vendor master. On the Purchase Order Table the Product Id (product being ordered) is a repeating (10 times)field, as is the product description, Qty, unit price, and extended price. In the Item Master, each product is its own record with its pricing info, quantity currently in inventory, vendor product is bought from,etc. I also have a field labeled "On Order." Item Master and Purchase Order tables are related by the Product ID. What I would like to do is get the total quantity of a particular product on order in the Purchase Order Table to be displayed in the "On Order" field in the Item Master. So if there are 10 orders for product 'ABCD' all for 5 units, I would like "On Order" to return 50. Any ideas? Mark
T-Square Posted December 28, 2005 Posted December 28, 2005 Go relational! Create a table for LineItems, with fields for Purchase Order#, Item#, QTY, UnitPrice and ExtPrice. Summary fields in the Purchase Order and Item Master tables based on related ExtPrice and QTY fields (respectively) will give you totals for the particular entities (POs one the one hand, and Items on the other). HTH, David P.S.-- The Item Description field is not necessary in the LineItems table, since this info can be derived from the Item master table base on the Item# field.
Mariano Posted December 29, 2005 Author Posted December 29, 2005 David- Thanks for the reply... I am not totally following what the summary fields would display on the purchase order table. How would it know to only summarize by product, not all the products on the PO? Mark
Mariano Posted December 29, 2005 Author Posted December 29, 2005 I did a summary field in a sub-summary part on the Item Master that is looking up quantity on the Purchase Orders. What it is returning is the quantity of the product when it is on the first line of the PO. If it is in any of the repeating fields (PO lines 2-10) of the product ID, the quantity is not being added. Mark
bruceR Posted December 29, 2005 Posted December 29, 2005 The solution proposed by T-Square is dependent on dumping the repeating fields and going to a proper relational design, as he recommended. You really need to do that.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now