Display only yes (1 Viewer)

Design by Sue

Registered User.
Local time
Yesterday, 20:38
Joined
Jul 16, 2010
Messages
669
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
 

cheekybuddha

AWF VIP
Local time
Today, 04:38
Joined
Jul 21, 2014
Messages
2,320
Make the ControlSource of the textbox something like:
=IIf([YourYesNoFieldName] = True, "Yes", "")
 

Design by Sue

Registered User.
Local time
Yesterday, 20:38
Joined
Jul 16, 2010
Messages
669
Thanks - I am getting #Type!
 

plog

Banishment Pending
Local time
Yesterday, 22:38
Joined
May 11, 2011
Messages
11,668
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.
 

Design by Sue

Registered User.
Local time
Yesterday, 20:38
Joined
Jul 16, 2010
Messages
669
Is shows a yes/no

Screen Shot 2024-04-29 at 3.52.45 PM.png
 

plog

Banishment Pending
Local time
Yesterday, 22:38
Joined
May 11, 2011
Messages
11,668
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.
 

Design by Sue

Registered User.
Local time
Yesterday, 20:38
Joined
Jul 16, 2010
Messages
669
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: 26
Last edited:

plog

Banishment Pending
Local time
Yesterday, 22:38
Joined
May 11, 2011
Messages
11,668
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")
 

GPGeorge

George Hepworth
Local time
Yesterday, 20:38
Joined
Nov 25, 2004
Messages
1,980
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
 

Gasman

Enthusiastic Amateur
Local time
Today, 04:38
Joined
Sep 21, 2011
Messages
14,423
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?
 

CJ_London

Super Moderator
Staff member
Local time
Today, 04:38
Joined
Feb 19, 2013
Messages
16,663
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
 

Galaxiom

Super Moderator
Staff member
Local time
Today, 13:38
Joined
Jan 20, 2009
Messages
12,854
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.
 

CJ_London

Super Moderator
Staff member
Local time
Today, 04:38
Joined
Feb 19, 2013
Messages
16,663
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";;


 

GPGeorge

George Hepworth
Local time
Yesterday, 20:38
Joined
Nov 25, 2004
Messages
1,980
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

Top Bottom