MacDigger Posted August 3, 2001 Posted August 3, 2001 Hi! Here's the description: I have a library database, and I need to perform search on book titles. The problem is that some books contain articles inside themselves (implemented with related records). When a search is performed, I need to search for a "title" either in main book info, or inside articles which belong to that book. Currently, it is implemented so that user can either enter search string into "main title" field, or "related title" field in the search form. What I'm trying to do is to unify this search, so that in search form I have a single "title" field and the script would find books which either have corresponding "main" titles or "article" titles. Currently, I'm thinking about having the "main" title search string to be copied into "article" title field before the search is actually performed. BUT! In this case search is performed using logical "AND". Is there a way to make it use "OR"? I mean "search for books where (main_title="title" OR article_title="title")" Any suggestions are very welcomed!! TIA, Mike
DykstrL Posted August 3, 2001 Posted August 3, 2001 You ca do this via a script. Create a global text field (gTitle) and place it on your find layout. Create a script that takes the user to the find layout. The following script would need to be launched via a button after the search text is entered into the gTitle field. This is not exact, but it may get you started: Enter Find Mode Set Field (main_title,gTitle) New Request Set Field (article_title,gTitle) Perform Find
LiveOak Posted August 3, 2001 Posted August 3, 2001 "AND" searches are performed by entering data into multiple fields of the same Find Request in Find mode. "OR" searches are performed by entering data into multiple Find Requests in Find mode. That's why the scrip step is "New Record/Request/Page", because it acts differently depending upon the mode you are in. When you enter Find mode, you are give a single Find Request to enter data into. If you want additional Find Requests, they can be created from the Requests menu or usin the above script step. If you wish to omit records with a certain entry, you check the "Omit" box in the status bar. Scripting you find might look like: Enter Find Mode Set Field (Book Title, "How to Create OR Searches") New Record/Request/Page Set Field (Article Title, "How to Create OR Searches") with an Omit, the script looks like Enter Find Mode Toggle Status Area (show) <--- Must show when using Omit step Set Field (Book Title, "How to OR Searchees") New Record/Request/Page Set Field (Article Title, "How to Create OR Searches") New Record/Request/Page Set Field (Database Produce, "Microsoft Access") Omit This script would find all the book or articles on OR searches, but omit those where the mythical database field is set to Microsoft Access. -bd
MacDigger Posted August 3, 2001 Author Posted August 3, 2001 Oh my god!! It works! Thank alot! I never knew such an operation is possible with FM! Mucho gracias!
Recommended Posts
This topic is 8512 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 accountSign in
Already have an account? Sign in here.
Sign In Now