6 Replies Latest reply on Nov 30, 2012 8:47 AM by philmodjunk

    Using info from a checkbox set

    MatthewSpaw

      Title

      Using info from a checkbox set

      Post

           I am working on a "print layout" that calls back to a "check sheet" in the same database.  The checksheet is a checkbox set field with multiple values 1 through 13.  I need a calculation field on the "print layout" sheet that will say yes/no depending on if a certain box is checked on the "check sheet".  For example, if box 8 is for Training- I need a blank to return Yes on the "Print Layout" under the "Training Required" column.  I need ot be able to do this for a single value in the checklist, but also for multiple values for yes/no questions with mutiple parameters.

           My problem is that I have been playing with If statements, but they aren't outputting the way I need them too.  I can't use "=" because there will rarely be a situation where only the box in question checked is the one in the statement.  I need to return a yes or a no based on a single specific value in a checkbox set of a field.

           Perhaps I need to go about this without using an if statement, but im not sure how.   I'm hoping someone can point me into the right direction?

           I am using FM11Pro.

        • 1. Re: Using info from a checkbox set
          philmodjunk

               You will find it instructive to place a copy of your check box field on your layout next to the original copy but with the check box formatting removed so that you have an edit box to the same field. Then click different check boxes and watch what valuees appear and disappear in the field. This will tell you more about why the FilterValues function can be very useful with such fields.

               Not IsEmpty ( FilterValues ( YourTable::YourCheckBoxField ; "Training" ) )

               will return "True" if "Training" is one of the values in your checkbox field's value list and it has been selected.

               Not IsEmpty ( FilterValues ( YourTable::YourCheckBoxField ; List ( "Training" ; "Second value Here" ) ) )

               can be used to check and see if two specified values have been selected in the group.

          • 2. Re: Using info from a checkbox set
            MatthewSpaw

                 Thanks that worked great for most of my calculations, and I appreciate the quick response.  However, the second formula:

                 

                      Not IsEmpty ( FilterValues ( YourTable::YourCheckBoxField ; List ( "Training" ; "Second value Here" ) ) )

                 is returning true if any of the values listed are met (I think).  I need 9 of the checkboxes checked for a particular field to be true.  Can I set this formula up to return false unless 9 specific boxes are checked?

            • 3. Re: Using info from a checkbox set
              philmodjunk

                   try:

                   ValueCount ( FilterValues ( YourTable::YourCheckBoxField ; List ( "Training" ; "Second value Here" ) ) ) = 2

                   to test for both items selected, in your case, you'd list 9 values and check to see if the value count is 9.

              • 4. Re: Using info from a checkbox set
                MatthewSpaw

                     Thanks a ton

                • 5. Re: Using info from a checkbox set
                  MatthewSpaw

                       I am still working with this checkbox set, and need to make a project number field change colors to black with white text if training is required.  I have been working with conditiional formating to do this, but I cannot get it to work.  Any tips?

                  • 6. Re: Using info from a checkbox set
                    philmodjunk

                         Say you have a checkbox group with "Training Required" as one of the values for a field named YourTable::CheckboxFIeld

                         Then this expression can be used in a conditonal format to change the appearance of the selected field, button or layout text whenever that value is selected:

                         Not IsEmpty ( FilterValues ( YourTable::CheckboxField ; "Training Required" ) )