May 5, 200421 yr Hello...I have created a script using a Search Data field which is an entry field on its own layout (Search Form) to search for criteria in multiple fields in another (Entry Form) layout in my database. I've anticipated and scripted for most scenarios and everything is working well except, when user hits continue when nothing been entered into the Search Date field, it returns all records. I'd like to I Set Error Capture [on] with a message that says "you haven't entered anything" and have it go back to the Search Data field, but anything I've tried isn't working properly. When Set Error Capture is [off] and modify find is chosen, the script moves onto the Entry Form without allowing the user to enter the modified criteria in the Search Form. I've attached a pdf of my script to date, I'd appreciate any help in figuring out this last bit. Thanks Storage Locator.pdf
May 5, 200421 yr Change Set Error Capture to [On] and add this after the Enter Find Mode [Pause] Loop Exit Loop If [Length( Search Data )] Show Message ["You haven't entered anything."] Go to Field [search Data] Pause/Resume Script [indefinitely] End Loop After the test for whether records were not found and the user wants to try again, put Perform Script [subscripts, Find Everywhere] Exit Script instead of the redundant Else steps. You don't need to show all records or enter browse mode at the beginning, by the way.
May 6, 200421 yr Here's another option: Set Error Capture [ On ] If [ _FB = "Cancel" ] Set Field [ _FB, "Find" ] Enter Browse Mode Perform Script [ "ToggleView" ] Halt Script End If Set Field [ _FB, "Cancel" ] Toggle Status Area [ Show ] Enter Find Mode [ Pause ] Perform Find If [ Status( CurrentError) = 400 ] Beep Show Message [ Buttons: "Cancel", "Try Again", ""; Data: "You did not specify any find criteria." ] If [ Status( CurrentMessageChoice) = 2 ] Set Field [ _FB, "Find" ] Perform Script [ "FindMode" ] End If Else If [ Status( CurrentFoundCount) = 0 ] Beep Show Message [ Buttons: "Cancel", "Try Again", ""; Data: "No requests found that meet your find criteria" ] If [ Status( CurrentMessageChoice) = 2 ] Set Field [ _FB, "Find" ] Perform Script [ "FindMode" ] Else End If End If End If Set Field [ _FB, "Find" ] Enter Browse Mode Perform Script [ "ToggleView" ] "_FB" is a global field that is used for the "find" button label. The "ToggleView" script shows/hides the status area.
Create an account or sign in to comment