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
 
Back
Top