Graham Lauren shows how to search across multiple tables in Filemaker 7 and 8.

FileMaker's great merit is that it can enable almost anyone to construct simple, usable databases. The same benefit can undo entry-level users when first exposed to the multi-table structure and relationship potentials first presented in version 7, and now in 8. However, whereas earlier, single-table solutions provided a simple frame for searching, attempting to do so across multiple tables is undoubtedly more complex.

In answer to this problem, the following is a demonstration of how to build a simple, multi-table search routine, which you can embellish as you wish. As usual, there are many different ways to skin the FileMaker cat, but I have found that this, with minor variations around the edges, depending on the required outcome, works consistently for me.

To begin, we will assume that there are two different tables in the database, one labelled Friends and the other Contacts, or home and work, if you like, which will be presented as lists to be searched. In this example, the principal difference is that one will have as its primary focus individuals, and the other organisations. Other fields created, such as those for phone numbers, email and other address details might be largely the same.

To add to this, we'll add two more tables:

  1. Globals which comprises utility fields providing services to the search.
  2. SearchReturn, which is where the 'found' records turn up.

On top of these is a script routine, which interrogates each of the tables to be searched.

Outline

FileMaker displays table data in 'layouts' which principally 'belong' to a specific table. In simple terms, in the solution I outline here:

  1. The user enters a search string into a search field.
  2. If this search string is found in a specified field in one of the tables to be searched, this match returns a boolean positive result of '1' in another (calculated) belonging to the record in which it is found.
  3. Through scripting, the records containing the '1's are then retrieved from their respective tables and imported into the SearchReturn table, whose purpose is to store them temporarily until the user decides which record they wish to work on, at which point;
  4. Clicking a button on the desired record returns the user to that record in the table from whence it came.

    Ok, so here's the execution.

    Execution: Setting up the Tables

    In Filemaker's table-creation function, create the four necessary tables, as seen beneath. I give each their 'T*.' prefix only to ensure they will sort and display alphanumerically in my preferred order.

Do you need help with Mac? Gain advice from Builder AU forums

Comments

1

Emile - 13/07/06

OOoooo, this is a great technique. Is there any way you can provide a sample file download to better illustrate how it works? Thanks

» Report offensive content

2

ianj - 03/10/06

One quick comment about the table names. Using a "." character in a table name or a field name has the potential to cause untold grief if you need to web-enable the system or connect via ODBC/JDBC. It's generally a really bad idea.

ian

» Report offensive content

3

Ender - 25/11/06

I'm afraid I don't see the need for techniques like this that search across multiple tables. Tables should really be about different things. If you have two tables with similar types of things, then the tables should probably be combined (especially if they may need to be shown together in a common listing or report).

In this example, "Friends" and "Contacts" should really reside in the same table, with a Contact Type field used to distinguish between them. This structure would make this search and listing quite simple, with no additional tables or import scripts required.

» Report offensive content

4

yusuf alam - 24/01/07

I want to search the record from the existing table from the oracle database using visualbasic programe and it will display the result in to the text box
select * from student where st_roll =" ' text1.text ' "

» Report offensive content

Leave a comment

You must read and type the 6 chars within 0..9 and A..F

* indicates mandatory fields.

4

yusuf alam - 24/01/07

I want to search the record from the existing table from the oracle database using visualbasic programe and it will display ... more

3

Ender - 25/11/06

I'm afraid I don't see the need for techniques like this that search across multiple tables. Tables should really be ... more

2

ianj - 10/03/06

One quick comment about the table names. Using a "." character in a table name or a field name has the ... more

Log in


Sign up | Forgot your password?

  • Staff Aussies to pay more for Win 7

    If you are looking to make some money in these troubled times, perhaps importing copies of Windows 7 could be for you. Read more »

    -- posted by Staff

  • Staff Firefox: Greens want it, 3.5rc2 not up to par

    This week's roundup looks at the situation surrounding a campaign to change Outlook HTML renderer, a Greens MP wants to install Firefox but is restricted and all the photos from the iPhone 3GS launch. Read more »

    -- posted by Staff

  • Chris Duckett Microsoft misses the Outlook point

    Ask designers which mail program is the bane of their existence, and you'll find that Outlook tops the list. The reason why the most popular email reader is also the most painful is simple: it uses Word to render HTML emails. Read more »

    -- posted by Chris Duckett

What's on?