Calculated Control between Main Form and Subform

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a main form with two subforms (current month and two previous months)
that run off of three separate queries. The three queries run off of one
date field on a separate form. I am trying to do an If statement that
compares the figures in the main form to the 1st subform. Here is the if
statement:

= IIf ( Forms![Tripwire Step 3-A]![% Payments to Prior Month Charges] <
Forms![Comparison Tripwire-Step 3]![% Payments to Prior Month Charges] ,
"There has been a decrease", "There has been an increase or no change")

This returns nothing. It doesn't even save it in the control source field.

I tried putting the If statement in the respective query but it asked for
the date field several times and put the true statement in each record. The
if statement from the query is below.

Expr1: IIf([% Payments to Prior Month Charges]<[Comparison Tripwire-Step
3]![% Payments to Prior Month Charges],"There has been a decrease","There has
been an increase or no change")

I know this is probably pretty easy but I cannot seem to get it to work.
 
Cortney,

Assuming you are doing this on the main form, and assuming that
[Comparison Tripwire-Step 3] is the name of the subform, try it like this...
=IIf([% Payments to Prior Month Charges]<[Comparison Tripwire-Step
3].[Form]![% Payments to Prior Month Charges],"There has been a
decrease","There has been an increase or no change")

As an aside, I would recommend you avoid using characters like % and -
in the names of fields and database objects.
 
You guys make it seem so easy. Thanks a bunch. It works like a charm!!

P.S. Thanks for the advice. I will remember that.

Steve Schapel said:
Cortney,

Assuming you are doing this on the main form, and assuming that
[Comparison Tripwire-Step 3] is the name of the subform, try it like this...
=IIf([% Payments to Prior Month Charges]<[Comparison Tripwire-Step
3].[Form]![% Payments to Prior Month Charges],"There has been a
decrease","There has been an increase or no change")

As an aside, I would recommend you avoid using characters like % and -
in the names of fields and database objects.

--
Steve Schapel, Microsoft Access MVP
I have a main form with two subforms (current month and two previous months)
that run off of three separate queries. The three queries run off of one
date field on a separate form. I am trying to do an If statement that
compares the figures in the main form to the 1st subform. Here is the if
statement:

= IIf ( Forms![Tripwire Step 3-A]![% Payments to Prior Month Charges] <
Forms![Comparison Tripwire-Step 3]![% Payments to Prior Month Charges] ,
"There has been a decrease", "There has been an increase or no change")

This returns nothing. It doesn't even save it in the control source field.

I tried putting the If statement in the respective query but it asked for
the date field several times and put the true statement in each record. The
if statement from the query is below.

Expr1: IIf([% Payments to Prior Month Charges]<[Comparison Tripwire-Step
3]![% Payments to Prior Month Charges],"There has been a decrease","There has
been an increase or no change")

I know this is probably pretty easy but I cannot seem to get it to work.
 
Back
Top