March 19, 200718 yr Newbies I am trying to make a search box in my client database layout, but am not sure on how to do it. I want to have an empty field where the search string is entered and by pressing a button the search is performed while still in browse mode. Thank you
March 19, 200718 yr What data does the search box search through? Searches have to be performed in Find mode. However to achieve what you want you can make the search box a global field, then script the process... Freeze Window Enter find mode Put the global field contents into the real search field Perform Find
March 19, 200718 yr Author Newbies Thank you for your answer. I am searching text fields (client name). How do I put the global field into the actual search field within the script? Thank you
March 19, 200718 yr Newbies enter find mode and then use set field. I've also created a search field, the search string is entered by pressing a button. However, is it possible to search pressing enter in that search field? (as in find mode). thanx.
March 19, 200718 yr Just to clear up the first bit: Enter Find Mode[] Set Field[ yourField ; yourGlobalField ] Perform Find[] Is it possible to search pressing enter? ... Yes and no. If you put a button in the tab order and change your field tab settings to go to next item in tab order on enter... Then if the user presses enter twice, it will execute the search i.e. User Enters data into field Presses Enter --> Goes to button Presses Enter Again --> Executes script attached to button.
March 20, 200718 yr Can you explain why you use Go To Field [ ] instead of Commit Records/Requests? :wink2:
March 20, 200718 yr Explain? No, not really. But I can ask: what have I done that would require committing? But the real question is what do you WANT to happen if user, in the middle of editing another field, clicks the button.
March 20, 200718 yr "what have I done that would require committing?" You have entered another field gSearchText which has 'Allow Entry' off. Maybe the User isn't editing the current record at all. Should not others be allowed to do so? "what do you WANT to happen if user, in the middle of editing another field, clicks the button." If they are off searching and probably ending up NOT on the existing record, I want it released for other Users to modify. It is my understanding that Go To Field [ ] would release the record as well. As in vs. 6, Exit Records/Requests works the same as Go To Field [ ] and is designed for this very purpose. Is Commit not the same in this regard? Go To Field [ ] *appears* more inefficient - it is like requiring an action of a non-action; whereas Commit or Exit Record just act. LaRetta
March 20, 200718 yr These are real problems. I don't think they can be solved in the context of a demo. You would need to understand the entire solution in order to choose the correct implementation.
March 20, 200718 yr I just found it unusual that you used Go To Field [ ] here and wondered if you had some secret reason. One other thing ... Your Find script pauses indefinitely. I do not see how it would ever Show All Records because it will never hit the test for IsEmpty() because there is nothing to trigger it? It is in Browse mode so hitting [Enter] doesn't fire a thing - just expands the field. If a User clicks outside of that field, the script continues running. I don't see that particularly as a problem in this case but imagine the User going off to another layout (even maybe based upon another table or table occurrence). Then they hit [Enter] and it fires. Then they would be Showing All Records in the wrong table which might upset their current found set in a different layout. Am I missing something here? Because I think I would supply a GO button just like Mac search since on Macs you can't loop here (testing that the field finally has contents). I might even be inclined to use event trigger on a standard search field like this since it would be all through my solution and since that would replicate most browser/Mac setups with the oval field & magnify glass (google-type thing). Just a thought. :wink2: Edited March 20, 200718 yr by Guest
March 20, 200718 yr It might be a Mac thing: on a Mac, you can hit the Enter key (not the Return key) to resume script.
Create an account or sign in to comment