May 26, 200520 yr I am creating a search page layout where the user can enter the search criteria into one field, but it pulls up records that have that data in one of any four different fields. For example, records contain several fields - Name1, Name2, Name3, Name4. The user enters "Joe" I need the Find to pull up any records contain the name "Joe" in either Name1, Name2, Name3, or Name4. I have tried using a Perform Find() script step. The user enters the search criteria into a global field called "Search". Then I tried editing the Find Request to look for records whose Name1 value contains the value of "Search" I kept coming up with zero records found. Am I going about this all wrong, or is there a way to use Perform Find() and have it find records based on the value of another field? Maybe my syntax is wrong. Any help will be appreciated. Thanks. Jason
May 26, 200520 yr You can either create a calculation field of Name1 & "_" & Name2 & "_" & Name3 & "_" & Name4 and perform your find in that field or you can use a script similar to the following: Allow User Abort [Off] Set Error Capture [On] Go to Layout [Find] Go to Field [gSearch] Pause/Resume Script [ ] If [not IsEmpty(gSearch)] Enter Find Mode [ ] Set Field [Name1; gSearch] New Record/Request Set Field [Name2; gSearch] New Record/Request Set Field [Name3; gSearch] New Record/Request Set Field [Name4; gSearch] Perform Find [ ] If [not Get(FoundCount)] Show Custom Dialog ["No records were found with the given criteria."] Show All Records End If End If Go to Layout [original]
May 26, 200520 yr There's a few ways to do an OR search on multiple fields. 1. Using a calc to concatonate the fields together into one field that can be used for searching. SearchField (calculation, text result) = field1 &
May 27, 200520 yr Author Thanks to both -Queue- and Ender for responding. I used a script similar to the one explained by -Queue-. My next question was going to be how to find records based on other field data or the results of a function, but using Enter Find Mode, then setting all the field data, then using the Perform Find[] script step, I was able to do just that.
Create an account or sign in to comment