Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 2004

    Question Unanswered: Searching records using variables

    Howdy all,
    I've reached a bit of a dead end with an idea I need to implement in my database.
    Here's my situation and what I would like to do:

    My database consists of multi-page forms that the users fill out. Each form has its own table due to the large number of fields required per each form. One field (Job#) is present in all tables and I've used it to relate the tables together. Ive set up a simple form and script to view multiple forms, picked by the user, simultaneously in different windows.

    What I need FM to do is automatically filter the displayed forms to show only the records with a Job# specified by the user. I know that you could manually sort each form by Job# using the Find tool but with 60+ different forms this is too time consuming. I was expecting to be able to use the Perform Find script command to do this but FM wont let me enter a field value (variable) for a Find Request Criteria.

    To illustrate the script I would like to run:
    Perform Find []
    Action = Find Records
    Criteria= Form::Table: [XXX]
    Where XXX is the Job# specified by the user

    Is there simple way to do what I need that Ive just not noticed or figured out yet? Im a novice at using FM. Any input or ideas would be greatly appreciated. I only hope Ive explained my situation clearly enough! J

    Thanks Much,
    Benjamin Kemp

  2. #2
    Join Date
    Jun 2004


    Have you tried using a global field? I haven't looked into how FM7 uses globals with the new tables format, if you can span multiple tables with it, but this used to be the way to pass a variable to a script.

  3. #3
    Join Date
    Apr 2004
    Yep, I ended up using a method using global fields suggested by a fellow on another board. In case anyone here is interested:

    Hello Benjamin,
    It's true that the Perform Find script command in FileMaker v7 does not support the use of field values. However there are some relatively simple alternatives.

    One way you might go about it is to set up your script to transfer the value(s) that you want to find into a global field prior to entering find mode, then use a Set Field[ ] comand in find mode to transfer the contents of the global field into the relevant field you wish to search on and then have the script perform the find without specified criteria (it will use the criteria entered by the Set Field [ ] steps).

    That way your finds can be fully scripted, yet can also be dynamic.

    /end quote

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts