Using a check box in a form

  • Thread starter Thread starter Brian
  • Start date Start date
B

Brian

This should be a fairly simple question, I'm just not sure
how to do it. I have a form with a feild "Tax" and a check
box "TaxCheck" Also, a feild "SaleAmount" I have the tax
auto calculating right now, but it does this no matter
what. What I want is for it to calculate only if the check
box is checked, and if not, automaticly enter 0 as the
value for Tax. Any help would be much appreciated. Thanks!
 
Presumably you are using the AfterUpdate event procedure of your Amount
field to write the amount of tax into the Tax field.

This example assumes a tax rate of 6%, and checks the value of the checkbox
TaxCheck:

Private Sub Amount_AfterUpdate
If Me.TaxCheck.Value Then
Me.Tax = Me.Amount * 0.06
Else
Me.Tax = 0
End If
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Iff statement 9
updated field 3
Check box Controls 4
EU orders Apple to pay €13bn in back taxes 11
Tax exempt if checked? 4
Sub-Form 1
Check Box 1
after update in a text box 2

Back
Top