8 Replies Latest reply on Feb 1, 2011 2:29 PM by dinora

    Selecting all options on a check box set

    dinora

      Title

      Selecting all options on a check box set

      Post

      I have a databases that offers tours all over the world.  For each tour I have a check box set field which allows met to check which days of the week the tour can be operated.  Sometimes the tours can operate everyday of the week. 

      Is there a way to have an option to check all the boxes with one click, thus avoiding to have to check each day.

      I hope this is clear.

      Thanks

       

       

        • 1. Re: Selecting all options on a check box set
          philmodjunk

          Use a button to do this:

          Set Field [Yourtable::CheckBoxFIeld ; ValueListItems ( Get ( FileName ) ; "Name of your value list in Quotes"]

          • 2. Re: Selecting all options on a check box set
            raybaudi

            @Phil

            Hmmm... there is only one check for each record ( I think ! )

            • 3. Re: Selecting all options on a check box set
              philmodjunk

              We'll have to ask Dinora. I'm interpreting this as a single field check box group unless she states differently.

              • 4. Re: Selecting all options on a check box set
                dinora

                Hi Phil

                Thanks.  Yes I have a single field that has check boxes and I can check whether the tour operates

                Mon, Tue, Wed, etc

                Now I understand your button suggestion but I am not great with scripts. So I am going to type the script below and let me know if this is what you mean

                Set Field [Yourtable::CheckBoxFIeld ; ValueListItems ( Get ( FileName ) ; "Name of your value list in Quotes"]

                Set Field [Tours::Operation Days ; ValueListItems ( Get ( FileName ) ; "Days of the week"]

                Please advise if the above is correct meaning do I have to type on the script ValueList Items?

                then do I type Get ?

                What do I type under Filename?

                Thanks

                • 5. Re: Selecting all options on a check box set
                  philmodjunk

                  If your value list's name is Days of the week, then what you've posted,

                  Set Field [Tours::Operation Days ; ValueListItems ( Get ( FileName ) ; "Days of the week"]

                  is exactly the script step that you need.

                  ValueListItems is a function that returns a list of all the values in a specified value list. That's exactly what you need to select all the values in your check box field.

                  It has two parameters, the name of the file where the value list is defined and the name of the value list itself. By using Get ( FileName ) as the first parameter, you specified the name of your current file indirectly and this function will work for any value list defined in your current file, provided you correctly enter its name in quotes as the second parameter.

                  You could replace Get ( FileName ) with the actual name of your file entered in quotes, but then this function would fail to work if you were to change the name of your file. Using the functions Get ( FileName ) instead, avoids that issue.

                  • 6. Re: Selecting all options on a check box set
                    dinora

                    Yes my value list is called Days of the week

                    the script as I am typing it keeps being rejected as is asking me for an operator where I have listed the semi colon between days and valuelistitems

                    see below

                    Set Field [Tours::Operation Days ; ValueListItems ( Get ( FileName ) ; "Days of the week"]

                    Any suggestions.

                    • 7. Re: Selecting all options on a check box set
                      philmodjunk

                      Set Field has two specify buttons and you have to use both of them.

                      With Set Field selected in your script, click the upper button and select Tours::Operation Days. Then click the second button and enter the expression to the right of the semi colon. Do not try to enter the semi colon, when you click Ok to to dismiss the specify calculation dialog, you'll find that FileMaker has added that character for you.

                      • 8. Re: Selecting all options on a check box set
                        dinora

                        Yeah! It worked. many thanks