12 Replies Latest reply on May 19, 2009 8:06 AM by philmodjunk

    Blocking Data Entry

    TuxfordC

      Title

      Blocking Data Entry

      Post

      As I have previously commented, Filemaker is very new to me - although

      database programming is not a mystery.

       

      What I would like to do, is to block the entry of data into a field, unless

      another field - flagged - has a positive entry.  Even better, would be to

      mask this field unless the flagged field said "Yes".

       

      Can I do this?  I know how to do it in Pascal, but how about in Filemaker?

       

      Cheers,

      Tuxford

        • 1. Re: Blocking Data Entry
          KIDO
             <!--            @page { margin: 2cm }           P { margin-bottom: 0.21cm }        -->

          What FM Version are you using?

           

          If you are using FM 10 you can use the field script trigger on OnObjectEntry with a script to move to next field.

          If [ Upper ( your other field) = “YES” ]

          Go to Next Field

          • 2. Re: Blocking Data Entry
            raybaudi
              

            Hi KIDO

             

            interesting idea but that allows to enter the blocked field by drag and drop.

             

            Even the old ( but ever valid ) "portal trick" is a good choise to hide the field.

            • 3. Re: Blocking Data Entry
              KIDO
                 <!--            @page { margin: 2cm }           P { margin-bottom: 0.21cm }        -->

              Hi Daniele

               

              Nothing that the Set Field script step couldn't handle. The final script should look like this:

              If [ Upper ( your other field) “YES” ]

              Set Field [ your field; “” ]

              Go to Next Field

               

              Don't you think?

              • 4. Re: Blocking Data Entry
                ralvy
                  

                Why the use of the Upper function here? Isn't this true:

                 

                "yes"  = "Yes"

                 

                That is, isn't FMP using case insensitive logic to evaluate identity statements with respect to text strings?

                • 5. Re: Blocking Data Entry
                  KIDO
                    

                  Developing habit, just to prevent errors.

                   

                  I'm  not sure how FM handles "yES" or "yeS" or "YeS".

                  • 6. Re: Blocking Data Entry
                    TuxfordC
                      

                    Thanks KIDO and Daniele for advice.  Regrettably, I am working with FM 9 and am not sure if

                    the owners of the project wish to upgrade.  I'll put it to them.

                     

                    TuxfordC.

                    (Whose Italian is terrrible)

                    • 7. Re: Blocking Data Entry
                      ralvy
                        

                      Why not use Kido's formula without the GoNextField step, and make sure this formula is attached to the data entry field, and that field is set so that "calculation replaces existing data". This won't keep you out of that field, but it will always wipe out its data if the other field has "yes" in it:

                       

                      If [ Upper ( your other field) “YES” ]

                      Set Field [ your field; “” ]

                      • 8. Re: Blocking Data Entry
                        raybaudi
                          

                        KIDO wrote:

                         

                        Nothing that the Set Field script step couldn't handle. Don't you think?


                        No... no field level trigger can fire a script w/o the field being active, so any dragged text do not fires that script.


                        • 9. Re: Blocking Data Entry
                          philmodjunk
                            

                          For what it's worth, text comparisons in filemaker are not case sensitive. "YES", "Yes", "yes" will be treated as equivalent. The one notible exception is the substitute function.

                           

                          Thus the UPPER function is harmless but unneeded in the examples given in this thread.

                          • 10. Re: Blocking Data Entry
                            TuxfordC
                              

                            Hi again,

                                           My thanks to those who gave Help, including the useful advice

                            that FM is not case sensitive.  After trying various options, I ended by using

                            ralvy's suggestion, but regardless of what I tried, the Boolean test would

                            not evaluate and I was locked right out of that field - regardless of what

                            what was in the tested field.   Decided not to waste time, and have used

                            another option. Converted the layout display from an Edit Box to a Drop-

                            Down and wrote a suggestion saying "Leave this Box empty unless the

                            previous one says "Yes".  OK, its a workaround to get the project up and

                            running.  I'll look again at the Boolean math if I live long enough.

                             

                            Cheers,

                            TuxfordC

                               

                            • 11. Re: Blocking Data Entry
                              ralvy
                                

                              FirstField is a text field.

                               

                              SecondField is a text field with this AutoEnter formula, set to replace existing value:

                               

                              If ( FirstField = "yes" ; Self ; "" )

                               

                              You could evaluate FirstField for not being "yes", but I couldn't figure out how to type the not-equal sign in this post here.

                              • 12. Re: Blocking Data Entry
                                philmodjunk
                                  

                                "I couldn't figure out how to type the not-equal sign in this post here."

                                I've learned I can enter special characters here by copying and pasting them from a Filemaker Specify Calculation dialog box. :smileywink: