Jump to content
Sign in to follow this  
BobWeaver

I'm probably thick but.....

Recommended Posts

The simplest way is to add a flag field that you clear before the first find. Then, after the first find, set the flag field to 1 for all records in the found set. When you do the next find, include flag=1 as one of the search criteria. If you increment the flag field to 2 in this next found set and then do another search with flag = 2 as one of the criteria, and so on, you will not only have a progressively narrowing search, but you can always back up to a previous level by setting the search criteria flag>=1, for example.

Share this post


Link to post
Share on other sites

I'm probably completely thick but this is my problem.

I want to do a find on a found set.

Find Once then Twice to refine a found set.

Problem: if you do this, the second find doesn't operate on the found set but the whole set.

help!

tom

Share this post


Link to post
Share on other sites

Wouldn't using 'Modify Last Find' be easier?

Since the second search is refining the first one I think it's safe to assume that the second search will be using a different field than the first search. In this case all you would have to do is use 'Modify Last Find', set the search criteria into the field and hit find.

Share this post


Link to post
Share on other sites

The flag solution won;t work in multi-user situations because the flags will get "mixed-up" and records will be locked. Replacing fields values in large found sets on shared databases is a sure slow-down, too.

(The mixed-up problem can be solved but the record locking and speed hit still remain problems.)

Share this post


Link to post
Share on other sites

i created a very complex script to solve this problem a little while back. It can be a little processor intensive if you found set has more than, say, 200 records in it. I will see if i can find the script, but in a nutshell this is what it does.

you do your first find, then when you run this script it copies all the unique ID's from every record into one global field. So now you have a global field with all the unique ID's from each record in the found set.

The unique ID can be any field that is unique for each record in your database. Then i go into find mode and let them enter there find criteria. then when the script is continued it enters the first ID from the global field into the unique ID field, then the Find Request is dublicated, and you enter the next ID into the unique id field. Loop through this step until you have no more ID in the global field. (this loop is hte server intensive part). then perform the find.

it is complex, but it works in multi user environments. the only problem is that you have to make it so they can not create more than one find request when they are doing a find. doing so, will cause major problems.

When i get a second i will post the actual script in here.

Share this post


Link to post
Share on other sites

ok here we go.. first some notes

Contact ID Number is my unique ID field

gContactIDNums is a global field that contains a list of all Contact ID Numbers from the current fount set, on seperate lines. (how you get this field set is up to you)

code:

Allow User Abort [ Off ]

Set Error Capture[ On ]

Go to Layout[ Find ]

Enter Find Mode [ Pause ]

Freeze Window

Set Field [ Contact ID Number,LeftWords(gContactIDNums, 1) ]

Set Field [ gContactIDNums, RightWords(gContactIDNums, WordCount(gContactIDNums)- 1) ]

Loop

Exit Loop If[ WordCount(gContactIDNums) = 0 ]

Duplicate Record/Request

Set Field [ Contact ID Number, LeftWords(gContactIDNums, 1) ]

Set Field [ gContactIDNums, RightWords(gContactIDNums,WordCount(gContactIDNums) - 1)]

End Loop

Perform Find

If

[ Status( CurrentFoundCount) = 0 ]

Show Message[buttons: "Modify Find",“Cancel",""; Data: "No records match the find criteria."]

If

[ Status( CurrentMessageChoice) = 1 ]

Perform Script [ Filename: "Contact.FP5" (*), "Modify Find" ]

[ Sub-scripts ]

Else

Perform Script [ Filename: "Contact.FP5" (*), "Cancel" ]

[ Sub-scripts ]

End If

End If

Go to Layout [ List ]

Refresh Window[ Bring to front ]


Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.