Find and Replace Macro

ndello

Active Member
Joined
Oct 16, 2002
Messages
382
Hi,
I created a form and then put a search button on the form. How can i set the search button Match Case to be Any part of field instead of it always stating at Whole Field?

Thanks
Here is the macro of the button:
Private Sub Command36_Click()
On Error GoTo Err_Command36_Click


Screen.PreviousControl.SetFocus
DoCmd.DoMenuItem acFormBar, acEditMenu, 10, , acMenuVer70

Exit_Command36_Click:
Exit Sub

Err_Command36_Click:
MsgBox Err.Description
Resume Exit_Command36_Click

End Sub
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.

Trevor G

Well-known Member
Joined
Jul 17, 2008
Messages
6,708
Office Version
  1. 2016
Platform
  1. Windows
Read this extract, you haven't stated which version of access you are using.

Select the Tools -> Options menu to open the "Options" dialog window.
Select the "Edit/Find" tab. Select the "General Search" option button at
the top left of the window, then the "OK" button to close the window.
Access will continue to use your current setting that you've already
manually applied in the "Find And Replace" window (whether it's "Any Part of
Field," "Whole Field," or "Start of Field") for any future search during
your current session. That's why the new setting doesn't appear to "stick."
However, the next time you open the database in Access, it will use your new
default "Any Part of Field" for searches, so you won't have to apply it
manually again.

If using 2007 then select the Office Butotn and then Access Options, then in the options select Advanced, then look at the list and where it has Default Find and Replace Behaviour select the General Search. Then close the database, next time you open it and search will come up with the feature you need.
 
Last edited:

Trevor G

Well-known Member
Joined
Jul 17, 2008
Messages
6,708
Office Version
  1. 2016
Platform
  1. Windows
Glad to have helped.

Have a good weekend.
 

Forum statistics

Threads
1,171,186
Messages
5,874,238
Members
433,040
Latest member
techmichelle

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top