3 Replies Latest reply on Feb 4, 2009 4:09 PM by raybaudi

    Restricting data entry in a field



      Restricting data entry in a field


      During data entry into a record I require Field "#1" to equal  a simple "Yes" or "No" input. Then if field "#1" equals a "Yes" then I require the user to input a number > 0 into Field "#2".

      If field "#1" equals a "No" then I want field "#2" to be empty.

      Is there a simple method, by either a script or function or both, that I disallow entry into, blank out, or insert a "0" into Field "#2" If Field "#1" equals a "No"?

      The way I have it now, the user can still put a number, other than "0", into Field "#2" even if Field "#2" is a "No"

        • 1. Re: Restricting data entry in a field
             Is there anyone out there that can help me with this?
          • 2. Re: Restricting data entry in a field

            Howdy BamaJJ,


            I figure you'd rather hear from someone else since my last answer to this same question was off the mark...sorry about that...but since no one else chimed in, perhaps you'll tolerate me trying again...?...


            I haven't tried this, but have you considered a filed validation for Field#2 that is a calculation to the general effect of:





            I don't know if this would work in a validation, but all my other ideas require action after the fact.  Such as the script you mention to "insert a "0" into field #2"



            Show all records

            Go to Record/Request/Page [First]

            If [Field1 {not equal} "Yes"]



            Go to Record/Request/Page [Next;Exit after last]


            But this would happen after the user already entered it wrong.


            Additionally, there are some cool formatting options available on FMP10 that would also help you accomplish what you're after.  What version are you using?

            • 3. Re: Restricting data entry in a field

              Hi BamaJJ


              you'll need to enter a calculation into the auto-enter option of Field2:


              Case( Field1 = "Yes" ; Field2 )




              another calculation into the validation option of Field2:


              Field1  ≠ "Yes" or Field2 > 0