Displaying text on a report based on the value of a numeric field

  • Thread starter Thread starter Madhav
  • Start date Start date
M

Madhav

Hi,
I have a numeric field in my database, lets say
field "flag". Now if the value of the record is 1, i want
a * to be displayed on the report. I have tried this code,
but it did not work :

IIF([flag]=1,"*","#"), but this did not work. Please help
me with this.
 
Madhav said:
I have a numeric field in my database, lets say
field "flag". Now if the value of the record is 1, i want
a * to be displayed on the report. I have tried this code,
but it did not work :

IIF([flag]=1,"*","#"), but this did not work. Please help
me with this.

What do you mean by "this did not work"?

Where is that "code"?

If you placed that expression in the control source property
of a text box control, then you must preceed it with an =
sign:
=IIf([flag] = 1, "*", "#")

If you're using the expression in VBA, you should include
more of the code so we can see what else may be going on
around it.
 
Hi,
Yes, I have placed the code in the control source
property only, and I have placed the exact code mentioned
by you. But on the report it displays #Error. Please
advise me as what should be done.
 
Make sure the name of the control is not also the name of a field.

--
Duane Hookom
MS Access MVP


Madhav said:
Hi,
Yes, I have placed the code in the control source
property only, and I have placed the exact code mentioned
by you. But on the report it displays #Error. Please
advise me as what should be done.
What do you mean by "this did not work"?

Where is that "code"?

If you placed that expression in the control source property
of a text box control, then you must preceed it with an =
sign:
=IIf([flag] = 1, "*", "#")

If you're using the expression in VBA, you should include
more of the code so we can see what else may be going on
around it.
 
Thanks a lot. The mistake i was making was pointed out by
Duane. U r too good. Thanks again!!!
-----Original Message-----
Make sure the name of the control is not also the name of a field.

--
Duane Hookom
MS Access MVP


Hi,
Yes, I have placed the code in the control source
property only, and I have placed the exact code mentioned
by you. But on the report it displays #Error. Please
advise me as what should be done.
What do you mean by "this did not work"?

Where is that "code"?

If you placed that expression in the control source property
of a text box control, then you must preceed it with an =
sign:
=IIf([flag] = 1, "*", "#")

If you're using the expression in VBA, you should include
more of the code so we can see what else may be going on
around it.


.
 
Back
Top