vba code to bring up the search and replace window

Lifeseeker

Registered User.
Local time
Today, 13:38
Joined
Mar 18, 2011
Messages
273
Hi,

Does anyone know the VBA code to bring up the "search and replace" window in access 2007?

something like...

docmd.search and replace?

comments/thougth much appreciated
 
For Replace:
DoCmd.RunCommand acCmdReplace

For Find:
DoCmd.RunCommand acCmdFind
 
Last edited:
For Replace:
DoCmd.RunCommand acCmdReplace

For Find:
DoCmd.RunCommand acCmdFind

Thank you Bob.

Would it be possible to actually lock the "Look in" field on the "Find and Replace" window so it's always looking in one field after users make the change on the form?

I have noticed that the "look in" field changes after users have made changes to the main form.
 
Just create your own search form instead of relying on this. It is not that robust to use the built in one.
 
For Replace:
DoCmd.RunCommand acCmdReplace

For Find:
DoCmd.RunCommand acCmdFind

Hi Bob,

I was wondering what the VBA code is to close the Find and Replace box after the search has completed.

Thank you,

David92595
 
Hi Bob,

I was wondering what the VBA code is to close the Find and Replace box after the search has completed.

Sorry, that isn't possible (as far as I know). You would need to create your own search form to have that kind of control.
 

Users who are viewing this thread

Back
Top Bottom