1 Reply Latest reply on May 31, 2015 7:25 PM by philmodjunk

    Auto fill check box according to result of calculation?

    AndrewGosling

      Title

      Auto fill check box according to result of calculation?

      Post

      Hi Alll… 

      I have a Filemaker database for an upcoming kids holiday program that I am trying to automate a bit more.  We scan in name tag barcodes and then manually fill in a check box for attendance (Mon, Tues, Wed etc). 

      Is it possible to automatically fill in a checkbox when the name tag is scanned in?

      For example, can you write a script or calculation to look up the days date (say Monday, 1 May 2015) and then tick the "Monday" check box field?

      Any advice will be greatly appreciated!

        • 1. Re: Auto fill check box according to result of calculation?
          philmodjunk

          Is this one field with multiple check boxes or mutliple fields  with one check box value for each field? Multiple Records, with a single value check box for recording attendance would actually be best.

          For a script to select a single value check box, the script need only set the field to the exact value specified in the value list.

          If your value list is a single value that reads "Monday", then:

          Set Field [YourTable::attendanceField ; "Monday" ]

          will cause the field to display a selected check box.

          If you have multiple values for your field (multiple check boxes to one field), you set up code such as:

          Set Field [ YourTable::attendanceField ; If ( IsEmpty ( FilterValues ( YourTable::attendenceField ; "Monday" ) ) ; List ( YourTable::AttendanceField ; "Monday" ) ]

          This expression appends the specified value in quotes to the return separated list of values already selected in the field. The If function makes sure that if a check box has been selected already, it can add the value to the list twice--which can negatively affect the user's ability to clear a check box previously selected.

          Hint: If this is a multiple check box field, try putting a copy of that field formatted as an edit box next to the check box field as an experiment. Then try clicking and clearing different check boxes. The edit box formatted copy will show you what data is actually stored in the field.