435,052 Members | 1,303 Online
Need help? Post your question and get tips & solutions from a community of 435,052 IT Pros & Developers. It's quick & easy.

# Check box to alter calculation field

 100+ P: 164 Hey all! Happy new years! I was having some difficulty trying to get this one figured out and I was hoping I could get some pointers on the board. Here is my form: http://www.mykesdesigns.com/jwservices.jpg Pretty basic... In the bottom left, starting with "Subtotal" it is getting its total from "Service Charge" , "Mileage Charge" which is .40 cents multiplied by the number of miles in the "Mileage Field" and "misc. Charge" all summed together. THEN the "Sales Tax" field is automatically populated by taking .0592 multiplied by the "Subtotal" field. Then of course the "Total Amount" is the "Subtotal" and the "Sales Tax Charge" Summed together. What I wanted is to be able to check a box that is a "No sales tax" box that would exclude "Sales Tax Charge" from the "Total Amount" field. If I cant find a way to do this. I will just create two Total amount fields, but I though this would be a much slicker way of presenting this in the end. Any help is much appreciated. Thanks a bunch! Jan 1 '08 #1
5 Replies

 Expert 2.5K+ P: 3,532 You don't really say where/how you're doing these calcualtions, but the general syntax would be something like this: Expand|Select|Wrap|Line Numbers  If Me.NoSalesTaxCheckBox Then   Me.SalesTax =  0 Else   Me.SalesTax = Me.SubTotal * .0592 End If  Linq ;0)> Jan 1 '08 #2

 Expert Mod 15k+ P: 31,494 Assuming the subtotal TextBox is called txtSubTotal, the sales tax TextBox is called txtSalesTax & the CheckBox is called chkSalesTax... Your Me.txtSalesTax formula should be : Expand|Select|Wrap|Line Numbers =0.0592 * IIf(chkSalesTax, txtSubTotal, 0) Jan 2 '08 #3

 100+ P: 164 Assuming the subtotal TextBox is called txtSubTotal, the sales tax TextBox is called txtSalesTax & the CheckBox is called chkSalesTax... Your Me.txtSalesTax formula should be : Expand|Select|Wrap|Line Numbers =0.0592 * IIf(chkSalesTax, txtSubTotal, 0) Awesome, I will be giving this a shot tonight, Ill post with updates. Thank you! Jan 2 '08 #4

 100+ P: 164 Worked like a charm. After doing this I read up on the IIf function. Makes perfect sense. Thank you SO much. Jan 2 '08 #5

 Expert Mod 15k+ P: 31,494 Not a problem. Thanks for replying with the status - pleased it worked well for you :) Jan 2 '08 #6