1 Reply Latest reply on Oct 21, 2013 10:00 AM by philmodjunk

    Toggle script for individual field

    jrimback

      Title

      Toggle script for individual field

      Post

           The objective is to create a field that toggles (with a mouse click) between a character (preferably always X) and null (or blank).  [The representation of checkboxes in SQL Server is cumbersome to work with in SQL.]

           The reference (included below) seems close to this spec, but I am unable to get it to work.  A solution for the error in the attached .jpg or some alternate script would be appreciated.

      http://filemakermisc.wordpress.com/2012/09/17/toggling-boolean-or-onoff-indicators/

           [FM Pro 12 Acvanced]

           [S Chamblee - thanks for the solution (border) last night.]

      ToggleScript.jpg

        • 1. Re: Toggle script for individual field
          philmodjunk

               Your screen shot is clipped such that we can't see all that's on the left, but what I can see suggests that the [] are the wrong thing to use here as this is how you refer to a specific repetition in a repeating field (like an array index) and what you have inside the brackets is an expression that will return text.

               And if you want the tableoccurrencename::fieldName reference for the currently active field, use: Get ( activeFieldTableName ) & "::" & Get ( ActiveFieldName )

               But I don't see a reason in your original text why you would not just format a field to have a check box format instead of some more complex approach. A check box field can be set with a single value: 1 and resized to hide the 1 so that all is shown is the check box. Clicking it enters a 1. Clicking it again clears the 1.