make visible and change text of field.

cdoyle

Registered User.
Local time
Today, 15:29
Joined
Jun 9, 2004
Messages
383
Hi,

I have a field on my report, that has either a value of 1 or 2.

What I would like to do is, if the value is 1 hide the field, but if the value is 2 I would like it to display 'required' instead of 2.

Is there a way to do that with conditional formatting?
 
Have you tried using IIF in the ControlSource of the control?
=IIF([YourField]=1, "", IIF([YourField]=2,"Required",[YourField]))
 
I've been trying different IIF's but not like your example.

I just gave yours a try, but got the following error message

The expression you entered contains invalid santax
you may have entered a comma without a proceeding value or identifier.
 
try this

=IIF([YourField]=2,"required" ,"")

might work
 
=IIF([YourField]=2,"required" ,"")

might work


I get the same error,
I should be putting this in the conditional formatting screen right, with Expression is:

I found if I remove the first =, it gets rid of the error but it still doesn't work.
I still get the 1 and 2's in my report.
 
The formula goes in the text box

No,

you put the formula in the Control source for the text box.

Eg control source: =IIF([YourField]=2,"required" ,"")

the same as in a form control

hope that is clear

cheers

Dean
 
amended reply

set your original field as hidden then create a new blank text box with its control as described as before.

don't think you can do it using conditional formatting
 
Oh lol,
Now it makes sense!

I just did that, and it worked great.
Thanks to both of you!
 
Hi,
Didn't want to start a new post on something so similar to this.

I'm trying to make it so if the ID of this field is <1 display 'NONE'
Otherwise display the Policy Name using the policy name field.

I was trying something like this.
=IIf([Policy_ID]<1,"None",[Policy_Name])

But just causes an error for any greater than 1. How do I make it display the name?
 
It obviously doesn't like the name you've given for the field.

Make sure your spelling is right. Make sure you don't have more than one object (i.e. both a column and a text control) with the same name.

If you doubt that, try putting some other text value in the "false" portion of the Iif statement and you'll see that it will display just fine.
 

Users who are viewing this thread

Back
Top Bottom