Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SEARCH ALL FIELDS 2

Status
Not open for further replies.

barbara20

Technical User
Mar 23, 2005
1
0
0
US
How do I search all fields at once? Is there a script that I can run?
Thank you!!
Barbara
 
All fields at once ¿¿??

Can ou give the reason why you should want to do that in a database ?

If you want to go that way, make a multivalue - return separated field from all your fields.
Or you can search on that field, or use a relationship.
 
I have a similar question, and can give you a reason. One of the databases I manage is for a rose garden, with 6000 rose locations listed. There is a field for the current rose in any location, a field for the rose assigned to any location whether the rose is there or not, and about 4 fields that have been used for comments. If I want to look up the name of a rose and see if we have the rose, used to have the rose or are planning to get the rose, I need to check all 6 fields. It would be nice to be able to do that all in one search.
Jill
 
Make a combi field from all the fields you want to search on, something along these lines:

searchField (calc - text)=
yourfield1 & "¶" &
yourfield2 & "¶" &
yourfield3 & "¶" & etc...

Search on this field for your value.

HTH
 
Jean W
Can I do that in 5.5? If so- Where do I make a combi field- in Define Fields? Suppose the fields are named Rose, Default and Comment, exactly what would I type in the combi field? Sorry if I sound like an FMPidiot, but my books have absolutely nothing on this subject, and it would be SO useful.
Jill
 
>>Can I do that in 5.5?

Yes, no problem....

>> If so- Where do I make a combi field- in Define Fields?

Yes, make a new field zk_combo_ctu = calculation, text, unstored.
In the Specify Calculation box, locate a field you want in the combo field (upper left box) double click on it and it will appear in the formula box.
Make sure the pointer is at the right side of the text, click 1 on the & sign, click 1 on the “” sign and 1 on the sign, in the formula box click to the right to put the pointer outside the quotes and click again &, hit the enter key (not on the num keypad) and repeat this for each field you want.
Finally you wil have something like this:
Rose & “” &
Default & “” &
Comment

To work an easy way, make sure you have a ‘developer’ layout. There you can put whatever field you want to ‘see’ what the result is.

Put your field on that layout and go to browse mode.
Now you will see the values from the 3 field in a sort of column.

Best is to have a search screen (I don’t want my users to search on a regular screen), where you put the field on. Here you can search for each value that can be in the 3 fields.

Best way is to script your search, something along these lines, with a button (Search) somewhere on your main layout:
1. Search script:
Go to layout (your search layout)
Enter find mode () (no detail)
Go to field (zk_combo_ctu)
Halt script

Put a button on that layout ‘Find’
2.Make a script Find with 2 lines
Perform Find (Replace found set)
Goto layout (your main layout)

and attach this to your button.

Now, when you click the ‘Search’ button, FM will go to your search layout, in Find mode, in your combo field, and will wait for input.
When you hit the Find button on that screen, FM will perform the search and find every record where the input value is.

The script has to be tuned, so your system is going to the right layout when there is 1 record, multiple records or even no match, but that I will leave to you.

If you’re stuck with that, the forum is here....

>> Sorry if I sound like an FMPidiot, but my books have absolutely nothing on this subject, and it would be SO useful.
You’re NOT an FMPidiot,don’t ever use that word again.
:) ,you are trying to find your way in a program, something I did more then 15 years ago, without internet.
So, if you're stuck....

Happy FileMaking
 
That's Jean! I haven't had time to try this out yet, but I can understand your explanation, which is always a good sign. I will make a special search layout for this. After a search, I can always switch to a layout with the rest of the information. I'm sure knowing how to do this will come in handy in other databases, as well.
 
It works! I tried it on an old copy of the database. Took some tweaking to get the field written right, then to get the Find script right, but it really will check all the fields that might have a rose name in just one search, then show them in the layout that has all those fields.
 
That's the way to go, try and retry....

Now up to the next FM challenge...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top