By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,477 Members | 1,602 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,477 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
Share this Question
Share on Google+
5 Replies


missinglinq
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
  1.  If Me.NoSalesTaxCheckBox Then
  2.   Me.SalesTax =  0
  3. Else
  4.   Me.SalesTax = Me.SubTotal * .0592
  5. End If 
Linq ;0)>
Jan 1 '08 #2

NeoPa
Expert Mod 15k+
P: 31,186
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
  1. =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
  1. =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

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

Post your reply

Sign in to post your reply or Sign up for a free account.