Database Reference
In-Depth Information
TIP
It's a good idea to hide the Find Customers layout from the Layouts pop-up menu so people don't
accidentally switch to it without running your script. In the Layout Setup dialog box, turn off the
“Include in layouts menu” checkbox.
Figure 12-11. When a button runs a script, a paused script may already be running. This pop-up
menu lets you decide what should happen to it. Choose Halt or Exit to have the running script im-
mediately stop and the new script takes over. On page 680 you'll learn about the subtle difference
between these two. If you choose Resume, the button's script runs and then the paused script re-
sumes. If you choose Pause, then the paused script stays paused. You may need to use another Re-
sume step, on a button or within another script, to start the paused script up again.
Triggering A Find Script
Once you have your scripts and layout in place, the last decision to make is how the script is
run. You could put a Find button on the Customers layout. But what happens if people try to
find another way (like the Mode pop-up menu on the bottom of the window, or the
View→Find Mode menu command, or a keyboard shortcut, or the Status toolbar's Find but-
ton)? If you want to make sure that the only way people can find customers is through your
script, then a layout script trigger is the key. OnModeEnter runs whenever you enter a mode
on a particular layout. You get to decide which modes you care about, and which script to
run.
Setting it up is a snap:
Search WWH ::




Custom Search