Database Reference
In-Depth Information
To figure out which number to test for, decide what key combination you want to trigger
something in your script—Alt and Shift, say. When you write the script, add them up your-
self: 8 + 1 = 9. Then you can do a check like this:
Get ( TriggerModifierKeys ) = 9
NOTE
The Code() function has an alter ego called Char() . Given a code (or series of codes) this function
returns the original character equivalents. This function is far less useful than Code() (which is
commonly used for keystroke triggers). Use it, for instance, if you need to force a tab character into
a calculation— Char(9) —or something equally esoteric.
Creating a Simple Keystroke Trigger
Now that you've worked through the concepts, you're ready to create your page navigation
trigger. You can already use Ctrl-up arrow and Ctrl-down arrow to navigate through your re-
cords. But it'd be more convenient if the arrow keys worked without the modifier keys. You
want to be able to use the trigger in Browse and Preview modes, so you'll need a way to
short-circuit the arrow keys' behavior in Preview mode. The script you need navigates to the
previous or next page, depending on which key is pressed ( Figure 17-17 ).
Once you've written the script, you need to set up the keystroke trigger:
1. Switch to the Customers layout and then go to Layout mode. Choose Lay-
outs Layout Setup and then click the Script Triggers tab to select it .
Since you're applying a layout trigger, you start in Layout mode.
Search WWH ::




Custom Search