My.ADVISOR.com Sign-In
ID
Password

Member Center / Sign-Up
   
SUBSCRIPTION STATUS
If you are a subscriber to this publication, sign-in to access locked articles. To subscribe or renew go to www.AdvisorStore.com.
Go to Article

ADVISOR TIPS

FileMaker Pro Super Search

The super search is a method for quickly searching several fields without having to enter Find mode. Learn how to use it.

By Stuart Gripman, Crooked Arm Consulting founder and president, and Advisor Basics of FileMaker Pro technical editor


This tip goes back to the days when I carved databases on stone tablets. Although it doesn't require the very latest version of FileMaker Pro, it's proven its worth over the epochs. The super search is a method for quickly searching several fields without having to enter Find mode. Using a calculation field that consolidates the contents of several other fields, you can simply search the calculation field. It's a shotgun approach that won't satisfy every need, but is often handy to have around.


Figure 1: Stringing fields together is simple -- The ampersand is your glue.


Figure 2: They get around -- Global fields are known to be the most promiscuous of all the fields.


Figure 3: Oh, behave -- The author continues to scour FileMaker Pro for "Child Behavior" settings, but remains unsuccessful.


Figure 4: Exercise your options -- It doesn't matter what number you start with. Just make sure the second arrow's number is one greater than the first.

The first step is to define your super search field. In FileMaker Pro 9, choose File > Manage > Database and create a new calculation field named "SuperSearch" (in FileMaker Pro 7 or 8, choose File > Define >

Database). Your calculation simply combines the fields you want to search. For easy reading, I separate each field with a paragraph mark. Be sure to set your calculation result to "Text" as illustrated in figure 1.

Although you can theoretically string together as many fields as you want, it's best to keep it down to a handful. Likewise, avoid using calculation fields and related fields in your super search. Following the guidelines I've outlined , your super search will stay snappy.

While you're in there defining fields, add a text field called "g_SearchInput" (figure 2) and set it to global storage by clicking on "options," choosing the "Storage" tab, and selecting the global storage check box.

Now it's time to create the super search script:

# this script takes the content of the g_SuperSearch field and uses it in # a find on the SuperSearch calculation field
#
# don't attempt the search if g_SuperSearch is blank
If [ IsEmpty(Tips::g_SuperSearch) ]
  Exit Script [  ]
End If
#
# perform the find
Enter Find Mode [  ]
Set Field [ Tips::SuperSearch; Tips::g_SuperSearch ]
Perform Find [  ]
#
# display the results
If [ Get ( FoundCount ) = 0 ]
#--- no records found, show a message
Show Custom Dialog
[ Title: "No Records Found";
    Message: "No records match your search term."; Buttons: "OK" ]
Else If [ Get ( FoundCount ) = 1 ]
#--- one record found, switch to form layout
Go to Layout [ "Form View" ]
Else
#--- more than one record found, switch to list layout
Go to Layout [ "List View" ]
End If
Refresh Window
#
# clear the g_SuperSearch field so it's ready for the next search.
Set Field [ Tips::g_SuperSearch; "" ]
Commit Record/Request [  ]

The final task is to place the gSuperSearch on a layout with a button that triggers your new script, the SuperSearch calculation field doesn't have to appear on any layout. You can arrange your search field and button however you'd like, although a few refinements will yield the best user experience. After you place g_SuperSearch on the layout, remain in Layout mode and select it. Now choose Format > Field/Control > Behavior… (figure 3) and check "Select entire contents of field when entered." This option lets users start typing as soon as they click on the field; any existing text will be overwritten. Next, select all three boxes under "Go to next object using" to cause FileMaker Pro to move out of the field when the user presses the Tab, Return, or Enter keys.

The final task is to put the search button in the tab order. Place your search button next to the g_SuperSearch field. In Layout mode select Layouts > Set tab order. FileMaker Pro places arrows next to each field and button on your layout (figure 4). Make sure the search button's number is one greater than the g_SuperSearch field. Now when you switch to Browse mode and type a search term in g_SuperSearch, press return to move to the search button. Press return again to perform the search.

That's it! You are now a super searcher.

Stuart GripmanStuart Gripman is the founder and president of Crooked Arm Consulting, a FileMaker Solutions Alliance Partner firm in Berkeley, California. He previously held Senior Support positions at Claris Corp. and FileMaker Inc. Since 2000, Crooked Arm Consulting has offered custom FileMaker solutions benefiting a wide variety of people and causes from fine art patrons to the International Space Station. http://www.crookedarm.com stuart@crookedarm.com

Printer-friendly
page layout

Super Search

No reader comments ... yet.

    What do YOU think about this topic? Share your advice and thoughts using this form.

    Your Name

    REQUIRED : PUBLIC

    Your E-Mail

    REQUIRED : PRIVATE

    Job, Company

    OPTIONAL : PUBLIC

    City, State, Country

    OPTIONAL : PUBLIC

    Your Web Site

    OPTIONAL : PUBLIC

    Your Comment

    Please help everyone by keeping your comments on-topic, using clean language, and not defaming or making personal attacks.


    Your e-mail address is required, but it will not be displayed to the public or given to anyone. See our Privacy Policy. Comments become visible after they pass our spam filter, and spammers and abusers are permanently blocked. Please report spam or abuse.

    ARTICLE INFO

    Web Edition: 2008 Week 09, Doc #19382

    FREE ACCESS FREE ACCESS

    Keyword Tags: FileMaker, FileMaker FileMaker Pro, FileMaker Users

    ADVISORAMA
    When Alexander the Great visited Diogenes and asked whether he could do anything for the famed teacher, Diogenes replied: 'Only stand out of my light.' Perhaps some day we shall know how to heighten creativity. Until then, one of the best things we can do for creative men and women is to stand out of their light.
    -- John W. Gardner (1912-)

    Use of this or any other site, content, product or service of Advisor Media constitutes acceptance of Terms of Use.
    Portions copyright ©1983-2010 Advisor Media, LLC. All Rights Reserved.
    Reuse or reproduction of any portion or quantity of Advisor Media's copyrighted content, in any form, for any purpose, requires written permission.
    ADVISOR®, the ADVISOR logo, and other names and logos that incorporate ADVISOR are registered trademarks, trademarks or service marks of Advisor Media, LLC in the United States and/or other countries.
    Other trademarks are used for identification, editorial or descriptive purposes and are the property of their owners.
    Hosted by Prominic.NET Website powered by
    LOTUS SOFTWARE
    ztfmfu0803 grips017-02 posted 2008-2-25 mod 03/15/2010 03:12:00 AM ztfmfu/
    domino-144.advisor.com my.advisor.com 03/21/2010 10:50:47 PM