View Full Version : Solved: Resetting "Find and Replace" Defaults
The Find and Replace window in Access has several options, each option has a default. I want to change the Match option from Whole Field to Any Part of Field. I would prefer to do this via some mysterious Options setting, but a line or two of VBA code would work just as well.
Thanks
geekgirlau
03-29-2005, 07:49 PM
Actually there is an option setting. Under Tools, Options, Edit/Find you can set the Default find/replace behaviour - the setting you want is "General search".
To do this via code,
Application.SetOption "Default Find/Replace Behavior", 1
many thanks. Using the Tools | Options approach is great for now.
After a little testing, I have to downgrade my rating from great to good. The option change works, and I thank you for pointing it out to me, but it also does something that I do not want -
The (original default) "Fast Search" searchs the selected field (Look In: = selected field) across all records for the all of the desired "text" (Match: = Whole Field).
The suggested "General Search" searches the entire table (Look In: = table) for any instance of the desired text (Match := Any Part of Field).
What I really want is a search method that defaults to:
Look In: = selected field
Match: = Any Part of Field
Any thoughts on how this can be done?
Thanks
geekgirlau
03-31-2005, 08:04 AM
Hmmm :think:
I can't find any other option that sets the default in the Find box. There is a "FindRecord" method and action (macros) that has a "Match" parameter - if you set this to "acAnywhere" with the "OnlyCurrentField" parameter set to "acCurrent", this will give you what you want. However this would require that you create your own custom search form that is launched when you press Ctrl-F, and that you customise the menu bar to replace the Edit/Find option.
There would be a bit of work involved - do you feel lucky? :dau:
DoCmd.FindRecord Me.txtSearch, acAnywhere, False, , True, acCurrent
Hmmm :think:
I can't find any other option that sets the default in the Find box. There is a "FindRecord" method and action (macros) that has a "Match" parameter - if you set this to "acAnywhere" with the "OnlyCurrentField" parameter set to "acCurrent", this will give you what you want. However this would require that you create your own custom search form that is launched when you press Ctrl-F, and that you customise the menu bar to replace the Edit/Find option.
There would be a bit of work involved - do you feel lucky? :dau:
DoCmd.FindRecord Me.txtSearch, acAnywhere, False, , True, acCurrent
creating custom forms and modding menu bars is within my skill level - I do lots of this in other MS appls. The " ... do you feel lucky?" is worrisome.:rofl: I will play around with this an IM you with results.
geekgirlau
03-31-2005, 02:09 PM
Actually I don't think it will be too difficult, just a lot of work to duplicate a built-in function because you cannot set the :censored: defaults! However think of this as a learning exercise and try to avoid the temptation to swear under your breath (or extremely loudly) at Microsoft.
MarcoBracher
08-08-2024, 01:22 AM
By changing the Access Options Client Settings 'Find/Replace Default' from 'Fast Search' to 'General Search', the value 'Search in:' in the search box is automatically set from 'Current field' to 'Current document'.
To set the default setting of the search function to 'Current field'/'Part of the field content', I recommend setting the registry entry '\HKEY_CURRENT_USER\Software\Microsoft\Office\16.0\Access\Settings\Default Find/Replace Behavior' to 4.
For clients that do not have a complete Access installation on their computer, this value must be created again.
Marco Bracher
Powered by vBulletin® Version 4.2.5 Copyright © 2025 vBulletin Solutions Inc. All rights reserved.