IIF Expression

  • Thread starter Thread starter dunkster via AccessMonster.com
  • Start date Start date
D

dunkster via AccessMonster.com

I have a report in which there is a Budget field and an Actual field.
If the Budget field is = zero and the Actual field is > zero I want to set
the Actual field to zero else leave the Actual field with its existing data
intact.
The IIF expression is as follows :
=IIF([Budget] = 0,0,[Actual])
The expression is entered in the ControlSource of the Actual control field.
This expression generates a "#error" message in the Actual control field.
 
Change the NAME property of the calculated Actual control to
something else ... since you are changing the control
source, you need to make the name different too -- like
ActualCalc
obviously, you will not be able to edit this since it's
source is an equation

use NZ in your equation in case values aren't filled out:

=IIF(nz([Budget]) = 0,0,nz([Actual]))

[Actual] will also have to be a control on the form

Have an awesome day

Warm Regards,
Crystal

MVP Microsoft Access

remote programming and training
strive4peace2006 at yahoo.com
 
Back
Top