IIF on forms and subforms

J

J9

Hi All,

I have a form set up with two subforms within it. The first subform is
called Property, the second subform is called Purchases.

I would like to set up an IIF that will display in the footer of my main form.

What I am trying to do is ; If half of [Cost] in the purchases subform is
greater than [maxrebate] on Property subform than show [maxrebate], otherwise
show half of [Cost].

The expression I have set up is
=IIF(SUM([Cost]/2)>[maxrebate],[maxrebate],SUM([Cost]/2)).

I have set up this expression to work when user hits a command button with a
macro set up ot it. The macro is set to the Action of SetValue and the above
expression in the expression field.

I keep on getting error messages that the object doesn't contain the
Automation object 'maxrebate'.

Is this because I am looking at two different subforms? Can someone please
help me with my IIF. I am only new to Access.

Thanks in advance...
 
Top