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

Related links

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 Microsoft prescribes more REST

    Details have begun to emerge about the next versions of Visual Studio and Windows Server this week -- and the message from Redmond is to REST up Read more »

    -- posted by Staff

  • Chris Duckett .NET looks to REST

    With news that REST will play a big part in the next version of the .NET Framework, it is timely to take a look at ADO.NET. Read more »

    -- posted by Chris Duckett

  • Renai LeMay Spellr.us needs a new dictionary

    One of the only Australian start-ups to present at the recent round of conferences in the US was Sydney-based spellr.us, which has launched a Web-based tool to check and monitor websites for spelling mistakes. Read more »

    -- posted by Renai LeMay

What's on?