Display only yes

Design by Sue

Registered User.
Local time
, 17:34
Joined
Jul 16, 2010
Messages
816
I have a yes/no field on a report and it is working fine except I would like only the yeses to appear- not the nos. So if the record in the report is no, the space for the field is left blank.

Thanks
 
Make the ControlSource of the textbox something like:
=IIf([YourYesNoFieldName] = True, "Yes", "")
 
Thanks - I am getting #Type!
 
My guess is you were incorrect and do not have a Yes/No field. Go into the design view of the table and tell me exactly what the data type of the underlying field is.
 
Is shows a yes/no

Screen Shot 2024-04-29 at 3.52.45 PM.png
 
And what was the actual code you put on the Report? You didn't just paste what cheeky typed did you? You changed it to the actual name of the field in your database, right?

Lastly, the name of that control on your report, it should be different than the field name you use in the table--since it no longer is actually that field--just put an 'x' in front of it if it is the same.
 
OK - duh - I think I have it. I created a new text field and added the code and it appears to be working. Thank you for sticking with me on this!
 

Attachments

  • Screen Shot 2024-04-29 at 4.09.44 PM.png
    Screen Shot 2024-04-29 at 4.09.44 PM.png
    12.4 KB · Views: 70
Last edited:
This is complicatedly simple. I think a lot of experienced people would miss it. The only reason I see it is my new reading glasses.

You've got 4 double quotes in that expression. The third one looks funky (look very closely at your last post, they look italicized almost), i don't think its actually double quotes and its throwing everything off. The good news is you don't even need it that argument. Just use this instead:

Code:
=IIf([Mandatory] = True, "Yes")
 
This is complicatedly simple. I think a lot of experienced people would miss it. The only reason I see it is my new reading glasses.

You've got 4 double quotes in that expression. The third one looks funky (look very closely at your last post, they look italicized almost), i don't think its actually double quotes and its throwing everything off. The good news is you don't even need it that argument. Just use this instead:

Code:
=IIf([Mandatory] = True, "Yes")
Good catch. Those quotes are definitely not all the same font.
1714422075532.png
 
For my benefit please, where is this errant double quote.
The one cheeky posted looks fine to me? and that is the only one I can see?
 
Those quotes are definitely not all the same font.
They are the same font, but a different character. I’m on my phone right now and if I type “hello” you can see two different ‘quote’ characters

think it is factor of keyboard settings
 
The sloping quotes are also called Smart Quotes in MS Office. They are automatically inserted into Word documents when you simply type the normal quotes on the keyboard and are a PITA when they creep into code.
 
I have a yes/no field on a report and it is working fine except I would like only the yeses
you can also use the format property

Booleans are numbers 0 for false, -1 for true

the format property allows for four states positive, negative, zero, null separated by semi colons.

So you could just set the format for the mandatory control to

;"Yes";;

or to add a bit of colour

;[red]"Yes";;


 
They are the same font, but a different character. I’m on my phone right now and if I type “hello” you can see two different ‘quote’ characters

think it is factor of keyboard settings
Correct. I stuttered, "character" not "font"? Is that possible when writing?
 

Users who are viewing this thread

Back
Top Bottom