When you click
Find on the
Edit menu in Form view, the
Find and Replace dialog box appears with the following default settings:
Find What: <clear>
Look In: current field
Match: Whole Field
Search: All
Match Case: <clear>
Search Fields As Formatted: <clear>
To alter these settings, start the
Find and Replace dialog box with the
RunCommand and use the SendKeys action to select alternate settings. For example, you can start the
Find and Replace dialog box by using a macro with the following actions:
Action Action Argument
------------------------------
SendKeys Keystrokes: %ha%n
Wait: No
RunCommand Command: Find
This macro can then be assigned to a command button, a button on a form,
or to an event on a form. When you run this macro, the
Find and Replace dialog box appears with
Any Part Of Field selected in the
Match box. The keystrokes sent by the SendKeys action are as follows:
- ALT+H to select the Match box setting
- "a" to select Any Part Of Field setting
- ALT+N to select the Find What box
The SendKeys action must come before the call to open the dialog box, even
though it may seem that the call to open the dialog box should come
first. However, if you place the call to open the dialog box first, the
macro runs the RunCommand action and then waits for the dialog box to be
closed before continuing to the next action (the SendKeys action), sending
your keystrokes to the form.
The following table lists which keystrokes to send to select various items
in the
Find and Replace dialog box:
Option Setting Keystrokes
-----------------------------------------------------------
Match Any Part of Field %ha
Match Start of Field %hs
Match Case <selected> %c
Search Fields as Formatted <selected> %o
Search Up %su
Search Down %sd
You can combine these keystrokes to make multiple selections. For example,
the following actions open the
Find and Replace dialog box with
Start Of Field selected in the
Match box; select
Up in the
Search box; and set the focus to the
Find What box:
Action Action Argument
------------------------------
SendKeys Keystrokes: %hs%su%n
Wait: No
RunCommand Command: Find