5 Replies Latest reply on Feb 7, 2014 7:14 AM by DanielLaughton

    Auto Text Entry

    DanielLaughton

      Title

      Auto Text Entry

      Post

           Hi There,

            

           Right now I am trying to create a field which will automatically enter data based on the data in another field. What I am hoping is that if another field called 'Exit Year' is empty or a specific value, the field I called 'Entry Year' will automatically put in yes. Otherwise it should select no. In the auto-calculation section I have the following formula to try and do that, but all it provide me with is an auto-entry of '0'. Here it is:
           If ( Exit Year = 13/14 ; "Yes"; "No" )  or  If ( IsEmpty ( Exit Year ) ; "Yes" ; "No" )

           I am not sure if this is how the if function works in Filemaker Pro, I am used to programming in C++, hence the confusion. If there is anyone who can help resolve this situation, I would be extremely grateful. Thanks!

            

           Dan

        • 1. Re: Auto Text Entry
          philmodjunk

               Well in C++, I don't think your syntax would work either. The Or operator is producinga Boolaean result of either True (1) or False (0).

               If ( Exit Year = "13/14" Or  IsEmpty ( Exit Year ); "Yes"; "No" ) 

               and 13/14 will be interpreted as 13 divided by 14 unless we put it in quotes.

          • 2. Re: Auto Text Entry
            DanielLaughton

                 No, I am aware it wouldn't work in C++ at all. Thank you so much for your help, that makes much more sense now that it has been explained.

            • 3. Re: Auto Text Entry
              DanielLaughton

                   I tried looking, to no avail. This calculation now works, but will only do so during data entry. If I change the 'If' statement parameters to be say, "12/13", it will only update the answer if I alter the individual files. Is there a way for Filemaker Pro to do this calculation for all records as the parameters change without having to go into individual the records themselves?

              • 4. Re: Auto Text Entry
                philmodjunk

                     Instead of "12/13" you can refer to a variable or field that contains the value and then you can control how this calculation evaluates by controlling what value is in the field or variable. As a C++ programmer that should be a familiar way to do this.

                     What may not be familiar is that in a database, you can set up a table where each record has a different value. You can then use a relationship to control which value is used in the expression at any given time.

                • 5. Re: Auto Text Entry
                  DanielLaughton

                       Perfect, thanks!