2 Replies Latest reply on Feb 9, 2012 4:01 PM by FionaWilson

    Auto Enter Current Date into Multiple Fields depending on check box selection.

    FionaWilson

      Title

      Auto Enter Current Date into Multiple Fields depending on check box selection.

      Post

      Ok this should be fairly simple but I can't seem to find the answer.

      I have a check box set with four values. Each value has its own date field next to it. Whenever a value is checked I want it to auto-enter the current date into the corresponding date field.

      I tried using an If function in each of the date fields like this:

      If (Field1 = "Value1" ; Get(CurrentDate) ; "")

      Which works fantastically when you select one check box but as soon as you check another the date disappears.

      Any ideas how I could get this to work?

      Fiona

        • 1. Re: Auto Enter Current Date into Multiple Fields depending on check box selection.
          philmodjunk

          With a check box group, you can enter multiple values by clicking more than one check box. The values are separated by returns. Once you click the check boxes for both Value1 and Value2. CheckboxField = "value1" is no longer a true statement. CheckboxField = "value1¶value2" is now a true statement.

          The way to check a list of values of this type to see if a specific value is present is to use the FilterValues function:

          FilterValues ( checkboxField ; "Value1" ) = "Value1¶"

          will be true only if the Value1 checkbox is selected.

          Not IsEmpty ( FilterValues ( checkboxField ; "Value1" ) )

          can also be used.

          For simpler implementation, you might use separate single value fields for your check boxes. Then your original expressions would work.

          You don't even need to use real fields for you check boxes. They could be Layout text such as an "x" or a checkmark character with conditional formatting defined to make the text appear only if the associated date field is not empty. The layout text can then be set up as a button that uses set field to enter the current date.

          To get even more layout flexibility, you can use a portal of related records with "checkbox" and date field in the portal row .

          • 2. Re: Auto Enter Current Date into Multiple Fields depending on check box selection.
            FionaWilson

             Thank you PhilModJunk

            Your first suggestion - FilterValues function - worked perfectly!!

            I knew there was a simple way of omitting the other values from the calculation.

            Thank you so much!!

            xx