cdoyle
07-02-2008, 07:25 AM
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?
RuralGuy
07-02-2008, 04:03 PM
Have you tried using IIF in the ControlSource of the control?
=IIF([YourField]=1, "", IIF([YourField]=2,"Required",[YourField]))
cdoyle
07-03-2008, 08:10 AM
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.
hardyd44
07-03-2008, 08:21 AM
=IIF([YourField]=2,"required" ,"")
might work
cdoyle
07-03-2008, 08:23 AM
=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.
hardyd44
07-03-2008, 08:31 AM
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
hardyd44
07-03-2008, 08:39 AM
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
cdoyle
07-03-2008, 08:42 AM
Oh lol,
Now it makes sense!
I just did that, and it worked great.
Thanks to both of you!
cdoyle
10-23-2008, 01:14 PM
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?
georgedwilkinson
10-23-2008, 01:22 PM
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.