Using a check box in a form

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!
 
A

Allen Browne

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


Top