Have a look at this post http://forum-en.filemaker.com/fm/board/message?board.id=FM-en-4&message.id=1419&query.id=60853#M1419 it sounds like just what you need.
Let me know if you have any additional questions.
Thanks for the info.
That definetily solved my problem
How would I modify the script to have it search more than one field in a single search?
For example, I want to be able to have my choice to search by account #, Last name or Company name all from within the same entry field.
You can add additional search criteria by including a New Record/Request step and then placing another set field for the next search request, so using the example from the previous post, your script would look something like this:
Allow User Abour [Off]
Set Error Capture [On]
Enter Find Mode  // Deselect 'Pause'
Set Field [ TABLE::AccountNo ; TABLE::GlobalSearchField ]
Set Field [ TABLE::LastName ; TABLE::GlobalSearchField ]
Set Field [ TABLE::CompanyName ; TABLE::GlobalSearchField ]
Perform Find 
#// Check result and if no records found alert user.
If [ Get ( FoundCount ) = 0 ]
Show Custom Dialog ["Message" ; "No Records Found."]
Enter Browse Mode 
Let me know how you get on.
That worked great.
Now to get a little fancier. Is it possible to start the search by hitting the 'Enter' key instead of having to click the button?
You sure can, using a script trigger plug-in.
I recommend Software4Humans EventScript plugin.
Use the S4HU_EventScript function in a new field that, in the Auto-enter calculation, referencing the global field, specifying the script to run and this will do the trick.
The script will trigger when the change is committed, which is when the user clicks or tabs out of the field after making the change, so if you want them to click enter you will need to change the fields behavior,
- In layout mode select the GlobalSearchField and go: Format > Field/Control > Behavior...
- Then tick the Go to next object using: as appropriate
Have a look into it and if you need anymore help on this let me know.
Thanks again Orlando.
I installed and played with the EventScript plugin for over 2 hours but could not get it to work.
I guess I'll just have to keep clicking the button.
No worries Joe,
If you would like me to put together a demo of this working with EventScrip then contact me back channel with your email address, Click on my profile and select "Send this user a private message" and I will email it over to you.
remember that EventScript do not work on some configuration ( expecially with 9 ).
But there is DoScript and ZippScript ;)
I did not know that, I have been using it in 9 on a Mac for a while now with no problems.
Do you have any more info on this? Is it platform specific etc?
Worth testing to see if it does work I suppose, I found it much easier than the other two you mentioned when I was testing them a while back.
Thanks Daniele, this is extreamly useful to know.
I may need to rethink my plug-in selection.
I just sent you a PM