twist on addition (1 Viewer)

ppoole16

Registered User.
Local time
Today, 06:43
Joined
Aug 21, 2003
Messages
57
I'm using the expresstion =[Money1]+[Money2] to sum two fields. However, I also need the expresstion to over rule the addition and make the total display 0 if a checkbox named "no bond" is checked. Any help would be great. Thanks.
 

WayneRyan

AWF VIP
Local time
Today, 06:43
Joined
Nov 19, 2002
Messages
7,122
ppoole,

Code:
Me.YourField =Iif([no bond] = True, [Money1] + [Money2], 0)

Wayne
 

Fizzio

Chief Torturer
Local time
Today, 06:43
Joined
Feb 21, 2002
Messages
1,885
=iif(NameofCheckbox = True,0 ,[Money1] + [Money2])

but this will depend on where you are performing the calculation, on a form or in a query.

Wayne got there First with the VBA example (except he got the statements all mixed up;) - but he did remember the name of the Checkbox!)
 

WayneRyan

AWF VIP
Local time
Today, 06:43
Joined
Nov 19, 2002
Messages
7,122
Fizzio,

Is having the function's arguments in the opposite order really
all that bad?

Wayne
 

Fizzio

Chief Torturer
Local time
Today, 06:43
Joined
Feb 21, 2002
Messages
1,885
Terrible, Should be a crime punishable only by hanging (mind you so should not lokking at what the control is called also) ;)
 

Users who are viewing this thread

Top Bottom