February 19, 200322 yr Hi everybody, I have a problem witch i can't seem to fix...I hope someone here can help me! I have 5 loose fields with a purchase price (purchase price1, purchase price2, etc...etc) witch are populated and 5 loose fields with a sale price (sale price1, sale price2, etc...etc) witch are not populated. Next to those fields I have a total saleprice field witch must be higher/same than the sum of the 5 fields with the purchase price. When I fill in the total sale price field, I want to run a script (or even a caculation in the 5 sale price fields) witch devides the total sale price over the 5 loose sale price fields. But the hard part is that the price that is devided in the loose sale price field may not be lower than the associated purchase price field. The fields are associated by purchase price 1 and sale price 1, purchase price 2 and sale price 2, etc...etc. Can anybody help here? Please let me know when it is unclear what I'am writing! greetz & thanx...Jeff
February 19, 200322 yr Do you want always want to divide the total-sales price equally on the 5 sales prices numbers (eg, 100 becomes 20+20+20+20+20) and then 'beep' if a salesprice is lower then the corresponding purchase-price, or do you want to make possible other divisions of that number 100 when there is a 'beep'? The first thing is easy, the latter more difficult. Give an example of what should occur please. In the first occasion, I think it is not to difficult to set up a field validation by calculation that prevents a total salesprice that is to low being entered. Harryk
February 20, 200322 yr But the hard part is that the price that is devided in the loose sale price field may not be lower than the associated purchase price field. A single Case calc here, but what should happen then ? For the rest, validate by calc as Harryk said...
February 21, 200322 yr salePrice1=Max(total/5,purchasePrice1) salePrice2=Max((total-purchasePrice1)/4,purchasePrice2) salePrice3=Max((total-purchasePrice1-purchasePrice2)/3,purchasePrice3) salePrice4=Max((total-purchasePrice1-purchasePrice2-purchasePrice3)/2,purchasePrice4) salePrice5=Max(total-purchasePrice1-purchasePrice2-purchasePrice3-purchasePrice4,purchasePrice5) Dj
Create an account or sign in to comment