Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
|
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 15th, 2009, 12:11 PM
Authorized User
 
Join Date: May 2004
Posts: 52
Thanks: 0
Thanked 0 Times in 0 Posts
Default Changing Match option on Find/Replace form

The line
DoCmd.DoMenuItem acFormBar, acEditMenu, 10, , acMenuVer70
brings up the Find and Replace dialog.

The default value for the Macth field is 'Whole field'

How can I automatically set the option Match to 'Start of Field' without clicking on it?
 
Old July 15th, 2009, 01:53 PM
Authorized User
 
Join Date: May 2004
Posts: 52
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I was able to get a solution from a Microsoft page:http://support.microsoft.com/kb/208923

The solution for me was the following code, using RunCommand vs. DoCmd:
Code:
SendKeys "%hs%n"
RunCommand acCmdFind
 
Old July 30th, 2009, 10:03 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,151
Thanks: 2
Thanked 14 Times in 14 Posts
Send a message via ICQ to SerranoG Send a message via AIM to SerranoG
Default

The SendKey command is very useful when all else fails, but is also very dangerous. Use it sparingly!

If anything grabs the attention of your computer, say you have a new e-mail message and it pops up an alert window OR you printed something and the print confirmation pops up at the wrong time, then the SendKey strokes you just issued will apply to that window and not the search window.

Now imagine if the window that gets the focus is some program you're running in the background and it decides to become active at that point. Those SendKey commands could order it to delete records or something not so pleasant depending on the menu keys you just sent it...
__________________
Greg Serrano
Michigan Dept. of Environmental Quality
Air Quality Division





Similar Threads
Thread Thread Starter Forum Replies Last Post
Changing variables in match templates chicken XSLT 0 September 11th, 2006 10:26 AM
Find and replace? Stuart Stalker SQL Server 2000 8 October 13th, 2005 02:49 AM
Effect of changing option value anshul Javascript How-To 4 May 17th, 2005 06:05 AM
Create a find and a find and replace in VB.NET snowy0 VB How-To 0 January 26th, 2004 07:03 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.