Use check box field in calculations

alguzman

Registered User.
Local time
Today, 15:53
Joined
Aug 2, 2001
Messages
63
Have form with amount due and three optional payments of a fixed amount. I have these three optional payments as a checkbox field. I put in a amount paid control box and want to show the total amount paid. If they did not selected any of the optional payments then the amount paid will just show their dues amount but if they selected to pay the optional payments then the check mark will add additional amount to the formula. I need help setting up the formula to read the check box and see if it is checked or not.
 
If you are using code:

TotalPaid = Me.TextBoxName
If Me.Check1 = True Then TotalPaid = TotalPaid + $40
If Me.Check2 = True Then TotalPaid = TotalPaid + $30
If Me.Check3 = True Then TotalPaid = TotalPaid + $20
Me.TextBoxTotalPaid = TotalPaid

If you want to put it in a statement, put the following in the ControlSource for the text box:

=[txtAmountPaid] + IIf([Check1]= True,40,0) + IIf([Check2]= True,30,0) +IIf([Check3]= True,20,0)


[This message has been edited by shacket (edited 08-30-2001).]
 
Thank you it works fine.
 

Users who are viewing this thread

Back
Top Bottom