By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,658 Members | 1,538 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,658 IT Pros & Developers. It's quick & easy.

Find - Search - Match: Any Part of Field

P: n/a
Is there any way to change the default search to "Any Part Of Field"
instead of whole field? The first thing I ever do when searching for
something in a field is change the default setting from "Whole Field"
to "Any part of field" because that way I don't have to key in the
entire word I'm searching for. It is especially frustrating having to
explain this to all of the people using my database. Any help would be
appreciated. Thanks.

Nov 13 '05 #1
Share this Question
Share on Google+
11 Replies


P: n/a
Change the setting under:
Tools | Options | Edit/Find
setting Default Find/Replace to General Search.

If you want to do this programmatically in your startup code:
Call SetOption("Default Find/Replace Behavior", 1)
--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Pete" <so**********@netzero.net> wrote in message
news:11**********************@g14g2000cwa.googlegr oups.com...
Is there any way to change the default search to "Any Part Of Field"
instead of whole field? The first thing I ever do when searching for
something in a field is change the default setting from "Whole Field"
to "Any part of field" because that way I don't have to key in the
entire word I'm searching for. It is especially frustrating having to
explain this to all of the people using my database. Any help would be
appreciated. Thanks.

Nov 13 '05 #2

P: n/a

Pete wrote:
Is there any way to change the default search to "Any Part Of Field"
instead of whole field? The first thing I ever do when searching for
something in a field is change the default setting from "Whole Field"
to "Any part of field" because that way I don't have to key in the
entire word I'm searching for. It is especially frustrating having to
explain this to all of the people using my database. Any help would be
appreciated. Thanks.


Are you letting people browse the raw data? Bad idea. Build a front
end GUI and connect to a back-end that's hidden from the users.

So, maybe you have a from in Continuous view or somesuch, and the user
is right-clicking on a column to search?

Build a proper search form. The way I do it is to split the form into
two, with the top part containing a bunch of unbound text boxes, check
boxes, combos etc. for the user to build his/her criteria for the
search. The top part also has a button marked "Search", and when the
user presses it code runs to build a query based on the criteria
supplied. You can then automatically pre- and ap-pend wildcards to
text values, combo values (if you're not using system-generated PK and
FK values, natch) etc. You'll also probably want a "Clear" button to
reset the search. The lower half of the form contains a subform to
display your data.

HTH

Edward

Nov 13 '05 #3

P: n/a

Allen,

I wanted to say Thank You! This has driven me crazy for months. With
every new employee I have to train them to move from the "Whole Field"
to "Any Part..." behaviour. I am very appreciative of your post. I
added this successfully to my switchboard and all the other forms work
great!

Peace,
Joseph

Nov 13 '05 #4

P: n/a
Allen,

Maybe spoke too soon...I rolled out the updated DB this morning.
Already within the first 15 minutes folks have noticed the defaults
have changed and I might have traded one problem for another. Turns
out people called to my attention that while the "Match" now shows up
with "Any part..." but the "Look In" option refers to the entire form
now instead of just the selected field. The drop-down does have the
option to change it to the field, and once that's done the first time,
all subsequent uses of Find|Search in that opened session of Access, on
any form, remain field specific. However it resets when Access is
closed. Is it possible to set that default as well?

Thanks,
Joseph

Nov 13 '05 #5

P: n/a
I'm not seeing that issue.

Using Access 2003, the Find button on the toobar defaults to the specific
field where the cursor is, unless you call it from something like a command
button. If that's what is happening, Screen.PreviousControl might help.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

<te********@hotmail.com> wrote in message
news:11*********************@f14g2000cwb.googlegro ups.com...

Pete wrote:
Is there any way to change the default search to "Any Part Of Field"
instead of whole field? The first thing I ever do when searching for
something in a field is change the default setting from "Whole Field"
to "Any part of field" because that way I don't have to key in the
entire word I'm searching for. It is especially frustrating having to
explain this to all of the people using my database. Any help would be
appreciated. Thanks.


Are you letting people browse the raw data? Bad idea. Build a front
end GUI and connect to a back-end that's hidden from the users.

So, maybe you have a from in Continuous view or somesuch, and the user
is right-clicking on a column to search?

Build a proper search form. The way I do it is to split the form into
two, with the top part containing a bunch of unbound text boxes, check
boxes, combos etc. for the user to build his/her criteria for the
search. The top part also has a button marked "Search", and when the
user presses it code runs to build a query based on the criteria
supplied. You can then automatically pre- and ap-pend wildcards to
text values, combo values (if you're not using system-generated PK and
FK values, natch) etc. You'll also probably want a "Clear" button to
reset the search. The lower half of the form contains a subform to
display your data.

HTH

Edward

Nov 13 '05 #6

P: n/a

Thanks for the followup Allen.

First, I'm Access XP.

Second, I've tested it from all three places (the toolbar button, using
Control-F, and the custom button included on the form).

All three methods behave the same.

I verified the code of my custom button on the form and it reads:

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

When I tried your suggestion, I encounter the Run-time Error 2483
(can't move focus to a previous control when only one control has had
the focus). I immediately removed it.

As I had mentioned, I initially placed the other code you suggested on
my Switchboard form and it affected all forms appropriately. So I
naturally went there to place the additional code suggested now. Maybe
I should try some where else. You had said in "the startup" code, but
I don't have any per se. At least, I don't think I do, which leads me
to think if I had it I would know about it and since I don't, I must
not. Maybe a recommendation then where to place a module that runs at
startup. Of course, I'd rather not place the code on each and every
form...unless that's necessary.

I appreciate your continued feedback.

Thanks,
Joseph

Nov 13 '05 #7

P: n/a
A second reply of sorts...

I've read more from MS website's online help tools and assistance
features, newsgroups, etc., and found more documentation about setting
these optons.

I've read the distinction of the fast (0), general (1) and start of
field (2) options.

However, and I'm probably not the first to point this out, let me point
this out...

http://office.microsoft.com/en-us/as...875061033.aspx

Article says:
"Select General Search to search all fields and match any part of the
field"

Why would we want to search ALL fields if we're looking for "ANY PART
OF THE FIELD"?

Certainly we don't need to search numeric fields, date fields, etc. for
text items and so on and so forth.

Not necessarily giving up, but wanted to share the irony with someone.

Looking forward to your help Allen. It is appreciated.

Thanks,
Joseph

Nov 13 '05 #8

P: n/a
Believe it or not, I'm making progress.

Here's what I began doing - adding "SendKeys" command through the
command button on the form.

Here's the code:
==============================
SendKeys ("{TAB}")
SendKeys ("{TAB}")
SendKeys ("{A}")
SendKeys ("{TAB}")
SendKeys ("{TAB}")
SendKeys ("{TAB}")
SendKeys ("{TAB}")
SendKeys ("{TAB}")
SendKeys ("{-}")
SendKeys ("+{TAB}")
SendKeys ("+{TAB}")
SendKeys ("+{TAB}")
SendKeys ("+{TAB}")
SendKeys ("+{TAB}")
SendKeys ("+{TAB}")
SendKeys ("+{TAB}")
SendKeys ("{BACKSPACE}")
==============================

The default search I'm using now is back to the "Fast" (option 0)
instead of "General" on the Switchboard. These keys basically move the
user through the Find & Replace box to each option and changes it from
"Whole Field" to "Any Part..." on Match and unchecks "As formatted..."
then returns the curson to the criteria box.

Now this is only working through the "Find" command button on my form,
not the Control-F or toolbar button.

I think in order to re-train the users, I need to consider breaking the
habit of using either Control-F or the toolbar, and guiding them to
only using the form button. If I wanted to consider removing those
from appearing in the toolbar, drop-down, etc., how would I go about
that? Or, if I do that, does it impact the overall functionality of
"Find"?

Thanks!

Peace,
Joseph

Nov 13 '05 #9

P: n/a
You are aware of the SendKeys bug where it messes with the state of Num
Lock?

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

<jk****@earthlink.net> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
Believe it or not, I'm making progress.

Here's what I began doing - adding "SendKeys" command through the
command button on the form.

Here's the code:
==============================
SendKeys ("{TAB}")
SendKeys ("{TAB}")
SendKeys ("{A}")
SendKeys ("{TAB}")
SendKeys ("{TAB}")
SendKeys ("{TAB}")
SendKeys ("{TAB}")
SendKeys ("{TAB}")
SendKeys ("{-}")
SendKeys ("+{TAB}")
SendKeys ("+{TAB}")
SendKeys ("+{TAB}")
SendKeys ("+{TAB}")
SendKeys ("+{TAB}")
SendKeys ("+{TAB}")
SendKeys ("+{TAB}")
SendKeys ("{BACKSPACE}")
==============================

The default search I'm using now is back to the "Fast" (option 0)
instead of "General" on the Switchboard. These keys basically move the
user through the Find & Replace box to each option and changes it from
"Whole Field" to "Any Part..." on Match and unchecks "As formatted..."
then returns the curson to the criteria box.

Now this is only working through the "Find" command button on my form,
not the Control-F or toolbar button.

I think in order to re-train the users, I need to consider breaking the
habit of using either Control-F or the toolbar, and guiding them to
only using the form button. If I wanted to consider removing those
from appearing in the toolbar, drop-down, etc., how would I go about
that? Or, if I do that, does it impact the overall functionality of
"Find"?

Nov 13 '05 #10

P: n/a
No.

What is it?

Is there a patch?

-Joseph

Nov 13 '05 #11

P: n/a
When you use SendKeys, it can mess with the state of the NumLock, and no,
there is on patch to fix this issue, despite the fact that the problem is
now 10 years old.

Info about this bug:
http://www.mvps.org/access/bugs/bugs0004.htm

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

<jk****@earthlink.net> wrote in message
news:11**********************@g43g2000cwa.googlegr oups.com...
No.

What is it?

Is there a patch?

-Joseph

Nov 13 '05 #12

This discussion thread is closed

Replies have been disabled for this discussion.