I have a control with a data source as follows:
=(IIf([chktaxable]=-1,[txtPriceNet],0)
I'd trying to set up another control that would sum this as follows:
=Sum(IIf([chktaxable]=-1,[txtPriceNet],0))
but I get an error.
Any ideas on what I can do?
Thanks.
Jeanette Cunningham - 14 Jan 2008 19:45 GMT
SAC,
try this:
=IIf([chktaxable]=-1,Sum([txtPriceNet]),0)
Jeanette Cunningham
>I have a control with a data source as follows:
>
[quoted text clipped - 9 lines]
>
> Thanks.
SAC - 14 Jan 2008 21:48 GMT
Thanks!!
> SAC,
> try this:
[quoted text clipped - 16 lines]
>>
>> Thanks.
SAC - 24 Jan 2008 01:04 GMT
Thanks!!
> SAC,
> try this:
[quoted text clipped - 16 lines]
>>
>> Thanks.
John W. Vinson - 15 Jan 2008 16:39 GMT
>I have a control with a data source as follows:
>
[quoted text clipped - 3 lines]
>
>=Sum(IIf([chktaxable]=-1,[txtPriceNet],0))
Not sure why that shouldn't work... but you can be sneaky and not use any IIF
at all!
Abs(Sum([chktaxable]*[txtPriceNet]))
will multiply the value of txtPriceNet by -1 if the item is taxable and by 0
if it isn't.
If txtPriceNet is a *form textbox* though, you can't sum it; you can only sum
field values in the form's recordsource query/table. You may need to do this
based on the actual table fieldname (PriceNet?) instead of the form control.
John W. Vinson [MVP]