OASES Posted March 19, 2001 Posted March 19, 2001 I'm using global fields in browse mode to enter my find criteria, but how do I allow the user to select Omit criteria?
BobWeaver Posted March 20, 2001 Posted March 20, 2001 I'm assuming that you are using a script to go into find mode and then copy the global values into the appropriate fields. Create an additional global field set up as a check box to allow the user to select 'omit' or not. When you execute the search, test the value of the omit global. If it is checked then execute an Omit Record/Request step in the script before you do the perform find step. If you want to select or omit multiple combinations of criteria, you will need an additional global omit field for each global search field. Then you will have to set up multiple search and omit requests in your search script. Exactly how you set this up will depend on how sophisticated you want the user's search options to be.
OASES Posted March 22, 2001 Author Posted March 22, 2001 Thanks for the response Bob. But does this mean that I can't use the "simple" find functions built into FMP already, such as multiple find requests, without having to create additional global variables such as FirstNameSearch1, FirstNameSearch2, etc.? So then basically the user's search options will be limited to how many I predetermine in the global fields?
BobWeaver Posted March 23, 2001 Posted March 23, 2001 Consider the following: Scenario 1 Search for all records whose First Name = "Bob" and omit records whose Last Name = "Weaver" Scenario 2 Search for all records whose Last Name = "Weaver" and omit records whose First Name = "Bob" Do you want to allow the user these kinds of searches? Both have the same field values, and include one find criterion and one omit criterion. Yet, they should produce different results. You have to decide just how complex you want the searches to be. The amount of information you need to get from the user will increase with the complexity. Can you describe in more detail what sort of searches you want the user to do?
OASES Posted March 23, 2001 Author Posted March 23, 2001 Ok, here's what I tried to do. I'm creating a database of students in our tutoring organization. It's a relational database with Tutee and TuteeProgramHistory (TPH), where Tutee has a portal to TPH to show multiple entries. However, regular searching will produce awkward results (searching for Fall 2001 students will yield me students from our Fall 2000 and Spring 2001 programs, since the search looks for any instance in any row of the portal). I tried to solve this problem by using global fields to create a hashed field (if the user wanted to find students for a particular semester and year, then through a calculation I would combine their query to a field called SemesterAndYear, instead of having two separate variables and thus allowing it to look for a combination in the rows. However, then I realized I can't really use the built in functions for searching. A definite goal of the database is to allow the user to search for all students enrolled in our Spring 2001 General Tutorial program but omit everyone from any Fall 2000 programs. The tutee database will be mainly used to autogenerate letters, create roster sheets, and create mailing labels and name tags. And all this relies on the ability to sort out those that are not in a specific tutorial program or a specific semester. Hope this clarifies to you what I'm trying to accomplish.
BobWeaver Posted March 26, 2001 Posted March 26, 2001 Doing finds in related records, as you have discovered, can lead to bizarre results. You should set up a calculated field in the related file like so: YearSemester = Year & Semester Then, put that field on the layout in your main file. Use it for searching. It should produce the results you want.
OASES Posted March 29, 2001 Author Posted March 29, 2001 I was trying to avoid doing something that would make the find page so messy, but I guess I can't avoid it. Thanks Bob for all your help.
BobWeaver Posted March 29, 2001 Posted March 29, 2001 There are a number of ways to keep the layout looking clean. Try using separate year and semester global fields, and don't display the related yearsemester calculated field. You can make a "Find" button script that does this: Go to Find mode [no restore] Set Field [TPH::yearsemester = year & semester] Perform Find [no restore] [ March 29, 2001: Message edited by: BobWeaver ]
Recommended Posts
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