9 Replies Latest reply on Feb 11, 2010 4:41 PM by philmodjunk

    Selecting an "All" option with checkboxes

    BayArea123

      Title

      Selecting an "All" option with checkboxes

      Post

      I have a layout that has 16 or so checkboxes that users check per record.  Sometimes they check one, but usually they check multiple at the same time.  It is becoming more and more that the users are checking all the boxes for certain records.  Is there a way to add a box that says "check all" and all the boxes will show an "X"?

       

      Thanks

        • 2. Re: Selecting an "All" option with checkboxes
          ralvy
             If you're using Filemaker Pro 10, then you can put a Script Trigger on that new Check All checkbox, where a script is triggered on Object Modify. The script would do one thing if the box is checked and another if it is not. If it's checked, have the script check all the other checlkboxes.
          • 3. Re: Selecting an "All" option with checkboxes
            philmodjunk
              

            There are several set field expressions that could be used in a script to check all the boxes. The script could be attached to a button or, as previously mentioned, be set up with a script trigger.

             

            Set Field [YourTable::YourCheckBoxField; ValuelistItems( Get ( Filename ) ; "Your Check Box value list name in quotes" ) ]

             

            Is one such script step that you could use.

            • 4. Re: Selecting an "All" option with checkboxes
              BayArea123
                

              Hi Phil, sorry it took so long to respond to this...

               

              This may sound silly, but I cant figure out how that script is entered.  I went to Script-New Script and double clicked "Set Field", and got the table and field to show up, but that is where I am stuck.  I can't figure out how to continue with the script. How do you enter the rest of the script? ....; ValuelistItems( Get ( Filename ) ;.......

               

              I tried doing it as a calculation without luck either, just got error messages

               

              Any help would be great, thank you!

               

              oh, also...do I actually need a new field for this to work? (the check all button).  Or just a script/button to run it?

               

              thanks

              • 5. Re: Selecting an "All" option with checkboxes
                philmodjunk
                  

                Many new users get confused when they first try to use Set Field in a script.

                 

                Since this is a one line script, you can specify Set Field from Button Setup... or create the script as you have started to do. Either way, you have two Specify buttons that appear for Set Field and you have to use both of them in order to get Set Field to work.

                1. Click the first Specify... button ( Specify Target Field ) to select the field you want set field to modify. In my example, you would select the check box formatted field you have already created so that it appears in place of "YourTable::YourCheckBoxField".
                2. Click the second Specify... button ( Calculated result ) to enter the expression to the right of the semicolon ";" do not enter this semi-colon as Filemaker will add it for you.

                No need for any additional new field here.

                • 6. Re: Selecting an "All" option with checkboxes
                  BayArea123
                    

                  Worked perfectly, thank you Phil!

                  • 7. Re: Selecting an "All" option with checkboxes
                    gsbilsky
                      

                    I am not using buttons.  When I Edit Script I see the following in the first screen

                     

                    Set Field [If(FilterValues(BankData::BankPayee;Payees_W_Cats::WherePayee)=Payees_W_Cats::WherePayee;Payees_W_Cats::ReportingPayee;"")]

                     

                    If I check the Specify Target Field and click on Specify the Calculation says it has to be numeric.

                     

                    I Check the Calculation Specify and it shows:

                     

                    If(FilterValues(BankData::BankPayee;Payees_W_Cats::WherePayee)=Payees_W_Cats::WherePayee;Payees_W_Cats::ReportingPayee;"")

                     

                    The script runs, but does nothing

                    • 8. Re: Selecting an "All" option with checkboxes
                      davidanders
                        

                      Rather than appending your question on an existing question

                      it would be best to create a new question.

                      This would require that your question is given it's own ID

                      This woud require that Filemaker look at your question as an original request.

                       

                      • 9. Re: Selecting an "All" option with checkboxes
                        philmodjunk
                          

                        David, I sent gsbilsky this link as an effort to help him out.

                         

                        All set field instructions should have two parameters separated by ; If your set field has only one, you are missing a key part of what you need for th script to work.

                         

                        The generalized format is: Set Field [TargetTable::TargetField ; Expression ]

                         

                        Your example shows: Set Field [ Expression ] and that won't work.

                         

                        Click on the first specify button and select a field to recieve the results of your calculation.

                        Click on the second button and enter a calculation.

                        Filemaker adds the ; for you.