Ballycroy Posted June 27, 2006 Posted June 27, 2006 I have a number field "Copy Cost" that gets filled in based on a selection from a pull down menu. Question: The user now wants the "Copy Cost" field to have a 0 amount if a particular selection is made from this pull down menu no matter how many words are in the "Ad Copy" and "Name of Individuals in Ad" fields. How would I incorporate this into my calculation? //get the total word count and set it to variable "C" Let( C = WordCount(Ad Copy & " " & Name of Individuals in Ad); //Check selection in pull down menu and apply relevant value to field "Copy Cost" Case(PatternCount ( Photo Size ; "Text Only" ); 50; //Check selection in pull down menu and apply relevant value to field "Copy Cost" PatternCount ( Photo Size ; "Then and Now" ); 0; //Calculate total cost if "C" is over or under 20 words 19 ) + .95 * (C - 20) * (C > 20) )
Genx Posted June 27, 2006 Posted June 27, 2006 I'm not sure i'm understanding you 100%, but nevertheless, just put your calc in an if statement: If(Table::SelectionField = particular value or Table::SelectionField = someother value ; 0 ; otherwise your calc)
Raybaudi Posted June 27, 2006 Posted June 27, 2006 Hi if the pull down menu is on the field: Photo Size, you just have a case statmenth wich gives 0 amount: //Check selection in pull down menu and apply relevant value to field "Copy Cost" PatternCount ( Photo Size ; "Then and Now" ); 0; so, to add another statmenth simply insert another row before the last row (like this) //Check selection in pull down menu and apply relevant value to field "Copy Cost" PatternCount ( Photo Size ; "particular selection" ); 0;
Ballycroy Posted June 27, 2006 Author Posted June 27, 2006 (edited) Thanks for your help guys. Sorry I was not too clear in my initial post. 2 Col. x 2 Black and White (Base Cost $19.00 includes 20 words extra words are 95 cents each) 4 Col. x 2 Black and White - Then and Now (No Cost up to 20 words extra words are 95 cents each) Text Only (Base Cost $50.00 includes 20 words extra words are 95 cents each) Baby's First Birthday - Colour (Base Cost $0.00. This Cost should remain at $0.00 no matter how many words) Baby's First Birthday - Black and White (Base Cost $0.00. This Cost should remain at $0.00 no matter how many words). My problem is setting the Copy Cost field to $0.00 when either Baby's First Birthday - Colour or Baby's First Birthday - Black and White. is selected. I have attached a simplified DB showing how it works at the moment. TestDB.fp7.zip Edited June 27, 2006 by Guest
Raybaudi Posted June 27, 2006 Posted June 27, 2006 (edited) see the attachment Edit: not exacty as I said TestDBRev1.zip Edited June 27, 2006 by Guest
Ballycroy Posted June 27, 2006 Author Posted June 27, 2006 Thanks for your help. I downloaded your revised DB. But when I added extra words (beyond the 20 already there) to "Ad Copy" field with "Baby's First Birthday - Colour" or "Baby's First Birthday - Black and White" selected, the "Copy Cost" field started to calculate the cost of the extra words. The result I am looking for in the "Copy Cost" field when the above items are selected should be $0.00 no matter how many words are entered into the calculated fields. I am still at a loss on how to achieve this.
Raybaudi Posted June 27, 2006 Posted June 27, 2006 OK Now I see better your problem... so try this TestDBRev1.zip
Ballycroy Posted June 27, 2006 Author Posted June 27, 2006 Thank you so much!! As a beginner I find it hard sometimes to wrap my head around nested functions!
Recommended Posts
This topic is 6786 days old. Please don't post here. Open a new topic instead.
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