conditional value

A

Apples76

I have a report which calculates the savings made at a projects final account.
however it also includes the interim payments.

my issue is where i have a payment recorded in one field but not the other
it allows the full difference to be claculated.

the fileds are:

Approved_ACQ_Costs
Approved_Bld_Costs
Agreed_Acq_Costs
Agreed_Bld_costs

savings are worked out by: Approved cost - Agreed cost

so if no Bld cost issued it would be 6000 - 0 = 6000 saving when this is not
the case.

how can i get the report to make the Approved value = 0 if the Agreed value
= 0


Thanks
 
K

Klatuu

The doing of it is simple, but you did not stay consistent with the names, so
you will have to use the correct name. Use the control source of the text
box where you want to display it:
=IIf(Agreed value = 0, 0, Approved value)
 
A

Apples76

Dave,

thanks ofr that, but now i either get a 0 or error result. my code is below.

=IIf([Agreed FA Value ACQ]=0,0,[Approved A&D Costs])

My fields are formatted to currency would this be an issue?
 
K

Klatuu

Being currency would not cause a problem. Is is possible [Approved A&D
Costs] could be Null? You may try this:
=IIf([Agreed FA Value ACQ]=0,0,Nz([Approved A&D Costs],0))
This will return a 0 if [Approved A&D Costs] is 0.
--
Dave Hargis, Microsoft Access MVP


Apples76 said:
Dave,

thanks ofr that, but now i either get a 0 or error result. my code is below.

=IIf([Agreed FA Value ACQ]=0,0,[Approved A&D Costs])

My fields are formatted to currency would this be an issue?

Klatuu said:
The doing of it is simple, but you did not stay consistent with the names, so
you will have to use the correct name. Use the control source of the text
box where you want to display it:
=IIf(Agreed value = 0, 0, Approved value)
 

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

Top