4 Replies Latest reply on Oct 9, 2010 5:20 AM by LaRetta_1

    How can I show a boolean value as text?

    MatthewCox

      Title

      How can I show a boolean value as text?

      Post

      I have a relatively simple problem that I can't seem to find a solution for. I am trying to show the the word "deaccessioned" on a particular layout that is used for hardcopy reporting in an art collection database. In the primary data-entry layout, this information is entered as a boolean value: radio buttons "yes" and "no". What I am hoping to accomplish for the hardcopy layout would be something like this: If "Yes", display "Deaccessioned" in the field, If "No", leave blank. I've uploaded a couple of screenshots hoping it would resolve confusion. Thanks for any and all help!

      Screen_shot_2010-10-08_at_10.52.21_AM.png

        • 1. Re: How can I show a boolean value as text?
          philmodjunk

          There's a way to format fields that contain a boolean value (1 or 0) to display text, but a fairly recently descovered limitation (aka bug) limits you to only 7 letters for this option.

          If you really want to use "deaccessioned", you'll need a calculation field set to return text:

          If ( deaccessioned = "Yes" ; "Deaccessioned" ; "" )

          You'd place this calculation field on layout instead of the radio button field to display this text.

          For More Information on this 7 character limitation, see:    Boolean Number format

          This is one of many acknowledged bugs that can be found in the Known Bug List here in the Report an Issue section of the forum.

          It can also be downloaded as a database file from:   http://www.4shared.com/file/8orL8apk/FMP_Bugs.html

          • 2. Re: How can I show a boolean value as text?
            MatthewCox

            Thanks for your quick reply. I found something similar to this the other day and couldn't get it to work out for me, and I am also having trouble with this. Here's what I have so far:

            I created a new text field in the same table titled "DeaccessionedText" with an auto-enter calculation: If ( deaccessioned = "Yes" ; "Deaccessioned" ; "" ). Inserted the new field into the table and it displays nothing when I am looking at a record that has indeed been marked "Yes". I have tried check and unchecking the "Do Not Replace Existing Value of Field" and "Do not Evaluate if all Reference Fields are Empty" with no luck. I'm missing something, but I don't know what it could be. Any ideas? Thanks!

            • 3. Re: How can I show a boolean value as text?
              philmodjunk

              Well I suggested using a calculation field, not a text field with an auto-entered calculation. That said, it should work, provided the two fields, the auto-entered text field and deaccessioned are in the same table. If they are not, the field will not update properly, but the calculation field I described will.

              • 4. Re: How can I show a boolean value as text?
                LaRetta_1

                PhilMOdjUnk said, "That said, it should work, provided the two fields, the auto-entered text field and deaccessioned are in the same table. "   No, the text field method won't work on existing data.  It will only work on newly changed records.  However, you are right on one thing ... text field shouldn't be used for this calculation.

                But creating a calculation is a bit of a waste as well when layout level variables can handle it if vs. 11 is being used.

                BTW, the limit on boolean display is not a bug nor is it recently discovered.  It has existed since vs. 7 first came out.  It is only a bug because, in vs. 11, Inspector allows User to type more than 7 and doesn't throw a message (as prior versions did).