5 Replies Latest reply on May 3, 2012 3:48 AM by LWayne_1

    Find Criteria using 3 fields in table

    LWayne_1

      Title

      Find Criteria using 3 fields in table

      Post

      Hi -

       

      When performing a find in manual mode, the find works fine.  However when I enter it "Enter Find Mode" in script it does not work.

      Field one is a number and it works.

      Field two is a number and it works.

      FIeld three is text and I am looking for blank records.  In the manual find I enter > " " and it gives me the records I want, however in the script it finds no records.

      I believe the problem is with the > operator and not having the proper quotes or brackets around it.  However nothing I tried has worked.

      I have entered the criteria for each of the three fields in "Enter Find Mode".  I have also used Insert Operator inserted the > operator and then added " ".

      Can someone tell me what changes I need to make?

       

       

        • 1. Re: Find Criteria using 3 fields in table
          philmodjunk

          ">" & Quote ( " " )

          should work, but it's simpler just to specify a lone = sign in the field to find records where the field is empty.

          In a script, you'd just use:

          Set Field [YourTable::YourField ; "="]

          • 2. Re: Find Criteria using 3 fields in table
            LWayne_1

            Phil -

            Thanks.

            I am sorry in my post I said all blank records; it should have been all non-blank records. I using your example I accomplished what I wanted.  Another question is when do you use Set Field versus Enter Find Mode and enter the criteria in that method?

             

            Thanks again,

             

            LWayne 

             

            • 3. Re: Find Criteria using 3 fields in table
              philmodjunk

              I personally prefer to set up a layout with global fields for the user to use to enter find criteria with a button on this layout that performs a script with Enter find mode[] followed by set field steps that build the requests from the data entered by the user into the global fields in almost all cases. Can't really remember the last time I had a script enter find mode and pause for user input.

              Please note that neither scripted method prevents the user from manually entering find mode and performing their own finds.

              • 4. Re: Find Criteria using 3 fields in table

                Enter find mode 

                set field 1 to dog

                set field 2 to brown

                New Record

                set field 3 to ==

                omit record

                Perform Find

                The omit record step will omit all records for the field that is empty. If this doesn't produce what you expect there are other methods.

                The problem is the type of find And, Or, etc.

                If you want to omit records that field 1 = dog and field 2 = brown and field 3 = "", that is different than the above find as the new record and omit will eliminate any field xx that is empty.

                So

                New record

                set field 1 to dog

                set field 2 to brown

                set field 3 to ==

                perform find

                This finds only records matching the first 2 criteria where the third is empty. The first version only finds records where the first two fields match and omits the ones with the empty field.

                • 5. Re: Find Criteria using 3 fields in table
                  LWayne_1

                  Jack -

                   

                  Thanks for presenting another approach regarding my question.

                   

                  LWayne