Expression builder and check boxes

Vesc

New member
Local time
Yesterday, 16:16
Joined
Jun 23, 2010
Messages
3
hi iv got a form which uses multiple check boxes , i need the "total" box to add or take away a value in a field when the check box is ticked or unticked.

this is as far as iv gotten in expression builder "Total"= [Points] + [HQ_Wargear_Sub_1.Wargear Cost 1]" but cant find out how to make "[HQ_Wargear_Sub_1.Wargear Cost 1]" only add to total if a box is checked.

iv uploaded a small example here: http://www.megaupload.com/?d=3Y2L3ETR (iv forgotten to add in a check box in form so add one yourself).
 
Firstly welcome to the forum.

A checked check box will return a numeric value of -1 or a boolean value of True whilst an uncheck check box will return a value of 0 or False. From there you can use and If Then statement to test you Check boxes and decide if you need to add [HQ_Wargear_Sub_1.Wargear Cost 1] or not
 
im having trouble how to write this up;
"Total"= [Points] + [HQ_Wargear_Sub_1.Wargear Cost 1] If then [Take 1-1?]=true" ????

[HQ_Wargear_Sub_1.Wargear Cost 1] = random number
[Take 1-1?] = checkbox

[Points] = random number

say [Points] = 60 and [HQ_Wargear_Sub_1.Wargear Cost 1] = 25 when the checkbox is ticked it adds 25 to 60, i keep getting 59?? with exp used above.
 
air code example...

Code:
If chkCheckBox = -1 Then
     txtTotalField = [Wargear Cost 1] + 1
Else
     txtTotalField = [Wargear Cost 1]
End If
 
With a field named Wargear Cost 1 are we dealing with non normalized data here????
 

Users who are viewing this thread

Back
Top Bottom