Jump to content
Server Maintenance This Week. ×

Search criteria into a field for reference


wcann

This topic is 8704 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • Newbies

I'm using FM Pro 4.0v3 on a Mac (though the answer to this shouldn't necessarily be platform specific).

Here's the scenario:

My file has about 10k records. I'm in List View with about eight fields running horizontally across. In the Header I've a tricky button labeled "Find" which (duh) enters "Find Mode." It's tricky because, once in Find Mode, it changes itself to "New Find" and enables me to make multiple search requests before I hit Enter to perform the Find.

When I've made a search and have a Found Set, I click on a scripted button which prints out the results via a different (unseen) print-only layout (b&w, optimized for size, smaller font, etc.)... so far, so good.

What I would like to be able to do is have the search criteria which I enter during the Find to appear on my print-out, that way I know what it was I was looking for when I made the search instead of having to make a hand-written notation on each page.

To reiterate - if I enter Find Mode and enter "bat" in one of the fields, then on my print-out of the search results there will be a field in the header labeled "Search Criteria" with "bat automatically entered.

Another example; if I enter "bat", then hit "New Find" and enter "bar" in the next Find Request, and again click "New Find" and enter "bac" in the third Find Request, I hit Enter and receive a single Found Set based upon those three search requests. When I make a print-out of the results, my layout has a field labeled "Search Criteria" and has "bat, bar, bac" automatically entered into it (separated by commas, by x number of spaces??...whatever).

Obviously, this field should clear itself with each new search.

I'm stumped as to how to go about this and any help or advice would be greatly appreciated. Thamks in advance!

Link to comment
Share on other sites

How about creating a new layout on which you only put globals. When you click your first find button it doesn't enter find mode it just takes you to the layout (in which you will enter all criteria and notes in browse mode). Let's say you only want to search in 2 fields - color and beast - and find records on bears that are brown or black. In Global_1a field you input "brown", in Global_1b you input "bear" and in Global_2a you input "black". In this case all the other 10 or howevermany globals are blank. The script for the find button on this layout could read something like

Enter Find Mode ()

Setfield ("color","Global_1a")

Setfield ("beast","Global_1b")

If ("not isempty(Global_2a)")

New Record/Request

Setfield ("color","Global_2a")

Setfield ("beast","Global_1b")

End If

....etc etc......

Perform Find

Setfield ("Summary",""Found set: " & Global_1a & " and " & Global_2a & " " & Global_1b"..... etc etc)

hth

Bill

[This message has been edited by Bill Hartford (edited May 13, 2000).]

Link to comment
Share on other sites

  • 2 weeks later...

Bill, Is there a way to use Setfield in a find using non global fields? I have been trying to do a find script using setfield, insert cal result, and other methods, and I have not been able to find anyway to use more than one "variable" in a find request. I would like to use multiple setfields specifying text fields in a find. By the way I am using FM 5. Thanks

Link to comment
Share on other sites

Well Nick - I suggested globals because

the only fields for which FM "remembers" the contents when you switch to find mode are globals. I'm sorry I don't know any other way to get the result you want. Was my response sufficiently clear that you were able to get it to work?

Bill

Link to comment
Share on other sites

  • 1 month later...
  • Newbies

Dear Bill,

You seem to know what your are doing with filemaker - I wonder if you can help me?

I simple want to make value list - each value having a different script -then if you click a button next to it goes to the relevant place.

Just like the ones you see on websites all the time.

Please be my Knight in shining Armour

Regards

Stella

Link to comment
Share on other sites

Hi Stella -

An "automatic exit" (to respond to the user's choice) is just a "little problem" blush.gif)

FMPro isn't set up to simply, automatically perform a script when a user tabs out of or into a field .........but there are workarounds.

1. The most straightforward method. Format your menu field as a popup list using your menu valuelist. After making a selection from the popup menu, the user would need to click on a "continue" button. The script behind that button would read the contents of the menu field and take appropriate action. If your valuelist for the menu field popup is only "yes" or "no" you can simply say

If (Menu = "yes")

Go to Layout (Option_1)

Else

Go to Layout (Option_2)

End If

If the valuelist is comprised of several options you should add a calculated field to your file so that the if/then/else statements in the script don't get too complicated to setup, debug or amend at a future date. If that is your scenario and you need help, just let me know what choices you include in the valuelist.

2. Alternatively, if you only have 2 (or 3) menu options and you don't want to have an extra button (or buy a plugin) format the field as a normal text field (not a popup) and as a button. Make sure you eliminate it from the tab order so the user has to mouseclick into the field. When the user clicks onto the field it'll run a script wherein you use the command "Show Message" to give the user a choice of 2 (or 3) options. Subsequent action depends on which button the user clicks on the message box - for example:

If (Status (CurrentMessageChoice) = 1)

Set Field (Menu, "Yes")

Go to Layout (Option_1)

Else

Set Field (Menu, "No")

Go to Layout (Option_2)

End If

(If you use that technique you may not even want a menu field, you might just want to have a button labelled "MENU"(?))

3. Final option, you can buy the "Script Scheduler" plugin. One of the things it provides is a function that will autorun a script when the user exits a field.

hth

Bill

Link to comment
Share on other sites

This topic is 8704 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.