Control has reference to itself

J

JMorrell

On a report, I have a bound control which displays numbers. If the value of
that bound control is zero, I don't want anything to print. If the value of
the bound control is greater than zero, I want to print that value.

I put an IIF() statement on that control but got an error that the control
has a reference to itself. My statement is:

=IIf([AUpdateVal]>0,[AUpdateVal],"")

My question is, how can I print a value greater than zero, or nothing at all?

tia,
 
F

fredg

On a report, I have a bound control which displays numbers. If the value of
that bound control is zero, I don't want anything to print. If the value of
the bound control is greater than zero, I want to print that value.

I put an IIF() statement on that control but got an error that the control
has a reference to itself. My statement is:

=IIf([AUpdateVal]>0,[AUpdateVal],"")

My question is, how can I print a value greater than zero, or nothing at all?

tia,

I don't see anything wrong with your expression.
Make sure the NAME of the control is NOT "AUpdateVal".
That will give an #error.

Another way to show nothing if the control value is 0 is to leave the
controls controlsource set to [AUpdateVal] (not the above expression).
Set the control's Format property to
#;-#;""

See Access Help.
Format Property + Number and Currency datatypes
 
J

JMorrell

Thanks Fred. That seems to have fixed my problem. However, when I entered
the format characters in the control's format property, the double quote
disappeared as soon as I saved the report.

I'll continue to check for further help on formatting.

Thanks again,
JMorrell


fredg said:
On a report, I have a bound control which displays numbers. If the value of
that bound control is zero, I don't want anything to print. If the value of
the bound control is greater than zero, I want to print that value.

I put an IIF() statement on that control but got an error that the control
has a reference to itself. My statement is:

=IIf([AUpdateVal]>0,[AUpdateVal],"")

My question is, how can I print a value greater than zero, or nothing at all?

tia,

I don't see anything wrong with your expression.
Make sure the NAME of the control is NOT "AUpdateVal".
That will give an #error.

Another way to show nothing if the control value is 0 is to leave the
controls controlsource set to [AUpdateVal] (not the above expression).
Set the control's Format property to
#;-#;""

See Access Help.
Format Property + Number and Currency datatypes
 
Top