April 2, 200520 yr I'm looking for a method for putting up a search layout, allowing the user to enter the search criteria, hit <return> to run the search, and then be able to re-display the search layout with the most recent search criteria, if the search needs to be refined. I can do this by using Browse Mode and using Globals on the search layout, but I don't like the fact that, in Browse Mode, the user can't hit <return> to make the script resume. I'd rather use Find Mode, for that reason alone. This eliminates the possibility of using Globals on the search layout. Here's what I'm doing currently: Set global fields to initial (null) values Loop -- Go to layout (search form) -- Enter Find Mode (NO pause) -- Set fields in search form from the global fields -- Pause Script /* allow user input */ -- Set global fields from data in search form /* save criteria */ -- Perform Find -- (Display results of find) -- Exit loop if user is finished End loop /* Iterate to redisplay search criteria and allow refinement */ The problem I'm having is that criteria such as "3/1/2005..3/15/2005" for a Date field, or "> 0" for a Number field, can't be retrieved, saved, and restored correctly this way. (These text strings have undergone conversion to Date or Number by the time I can get my hands on them.) Is there a way to save search criteria for re-use AND retain the functionality of having the <return> key cause the script to proceed? Gratefully, Chap
April 3, 200520 yr "the user can't hit <return> to make the script resume" That's because <enter> makes scripts resume. Set Field can only enter data of the correct type into fields... a date range is not a valid date so it won't work. Instead use Insert Calculated Result, but be aware that this script is layout dependent. IIRC, some time ago Bob Weaver posted a demo file with an impressive find recall system.
April 4, 200520 yr Author Thank you for pointing me to Bob Weaver's post. Lots of good stuff there to puzzle through. What I finally realized, though, is that what I needed was nothing but Modify Last Find! (If I'm not mistaken, Bob Weaver's script is mainly about displaying a Find request textually.) Chap
Create an account or sign in to comment