Newbies usit86 Posted March 19, 2007 Newbies Posted March 19, 2007 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
Vaughan Posted March 19, 2007 Posted March 19, 2007 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
Newbies usit86 Posted March 19, 2007 Author Newbies Posted March 19, 2007 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
Newbies kray5 Posted March 19, 2007 Newbies Posted March 19, 2007 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.
Genx Posted March 19, 2007 Posted March 19, 2007 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.
LaRetta Posted March 20, 2007 Posted March 20, 2007 Can you explain why you use Go To Field [ ] instead of Commit Records/Requests? :wink2:
comment Posted March 20, 2007 Posted March 20, 2007 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.
LaRetta Posted March 20, 2007 Posted March 20, 2007 "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
comment Posted March 20, 2007 Posted March 20, 2007 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.
LaRetta Posted March 20, 2007 Posted March 20, 2007 (edited) 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, 2007 by Guest
comment Posted March 20, 2007 Posted March 20, 2007 It might be a Mac thing: on a Mac, you can hit the Enter key (not the Return key) to resume script.
LaRetta Posted March 20, 2007 Posted March 20, 2007 Oh, yes of course! I didn't test it on my Mac. Thank you!
Recommended Posts
This topic is 6458 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