Change value from query when displayed in report text box

RogerC

Well-known Member
Joined
Mar 25, 2002
Messages
536
I have a report that uses a query to display all records that contain the text 'Blue' or 'Green' in the table's column named 'Color'. On the report, I need to 'convert' the text that is shown in the 'Color' text box control to this:

If the record contained 'Blue', show 'Yes' in the text box.
If the record contained 'Green', do not show anything (blank text box).

Can this be done?
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
Re: Change value from query when displayed in report text bo

Create it as a calculated field in your query (using the IIF statement). Then it is just a matter of selecting that calculated field to display in your report.
 
Upvote 0
Re: Change value from query when displayed in report text bo

In your IIF statement, simply return nothing, which is two double quotes with nothing in-between. Something like:

IIF(Condition, "Yes", "")
 
Upvote 0
Re: Change value from query when displayed in report text bo

Thanks jimisky! That worked perfectly!
 
Upvote 0

Forum statistics

Threads
1,221,783
Messages
6,161,938
Members
451,730
Latest member
BudgetGirl

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top