For some reason, the default value of "Search Fields as Formatted" in the Find and Replace dialog box in Access XP is Checked. Users must remember to uncheck it each time in order to get correct search results. In prior versions, defaults for this dialog box were set in Tools/Options/Edit/Find/Default Search Behavior. No more. A microsoft knowledgebase article suggests using a macro with SendKeys to "uncheck" (or actually to "check" it, since MS seems to think the default is unchecked) the option before opening the dialog box. One would then add a custom button on the toolbar or form and call the macro from the button.
Problem1: Macro only works from your custom button, so the keyboard shortcut CTRL+F brings up the standard dialog with Search Fields as Formatted checked.
Problem2: The Search Fields as Formatted checkbox is a toggle control. This means if you send a keystroke to "uncheck" it, it will work the first time, but the second call to the procedure will (with the same SendKeys command) "check" it. So 50% of the time you get the actual results you want.
I've searched but have not found a way to call the find dialog box with VBA and set the value of the options on this dialog through code. Any ideas?
Problem1: Macro only works from your custom button, so the keyboard shortcut CTRL+F brings up the standard dialog with Search Fields as Formatted checked.
Problem2: The Search Fields as Formatted checkbox is a toggle control. This means if you send a keystroke to "uncheck" it, it will work the first time, but the second call to the procedure will (with the same SendKeys command) "check" it. So 50% of the time you get the actual results you want.
I've searched but have not found a way to call the find dialog box with VBA and set the value of the options on this dialog through code. Any ideas?