Find Button

J

JP Martinez

I have a "Find" command on a form that I created using the built in control
wizard -how do I make it so that when
it comes up one of its fields changes to "Any part of field"

Thanks in advance.

-Pierre
 
6

'69 Camaro

Hi, Pierre.

You won't be able to control this setting with VBA 4.0 code (from Access
95), which is what the Button Control Wizard uses.

To apply the search option in VBA code, use the DoCmd.FindRecord( ) method.
Use acAnywhere as the second argument of this method to search in any part
of the field.

However, it would probably be easiest if you just changed the default option
setting for Access. To do so, 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. 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.

HTH.

Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.

(Please remove ZERO_SPAM from my reply E-mail address, so that a message
will be forwarded to me.)
 
J

JP Martinez

When you said use "acAnywhere" as the second argument you mean for the
following below:

DoCmd.FindRecord( ) , acAnywhere

I just want to make sure I do the syntax correctly.

thanks

-Pierre
 
6

'69 Camaro

Hi, Pierre.

The syntax is:

expression.FindRecord(FindWhat, [Match], [MatchCase], [Search],
[SearchAsFormatted], [OnlyCurrentField], [FindFirst])

The second argument, [Match] should be acAnywhere in order to get the "Any
Part of Field" for the Find dialog window.

HTH.

Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.

(Please remove ZERO_SPAM from my reply E-mail address, so that a message
will be forwarded to me.)
 
J

JP Martinez

thanks a lot

-Pierre

'69 Camaro said:
Hi, Pierre.

The syntax is:

expression.FindRecord(FindWhat, [Match], [MatchCase], [Search],
[SearchAsFormatted], [OnlyCurrentField], [FindFirst])

The second argument, [Match] should be acAnywhere in order to get the "Any
Part of Field" for the Find dialog window.

HTH.

Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.

(Please remove ZERO_SPAM from my reply E-mail address, so that a message
will be forwarded to me.)


JP Martinez said:
When you said use "acAnywhere" as the second argument you mean for the
following below:

DoCmd.FindRecord( ) , acAnywhere

I just want to make sure I do the syntax correctly.

thanks

-Pierre

message news:[email protected]... open
the button
 
6

'69 Camaro

You're welcome!

Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.

(Please remove ZERO_SPAM from my reply E-mail address, so that a message
will be forwarded to me.)


JP Martinez said:
thanks a lot

-Pierre

message news:[email protected]...
Hi, Pierre.

The syntax is:

expression.FindRecord(FindWhat, [Match], [MatchCase], [Search],
[SearchAsFormatted], [OnlyCurrentField], [FindFirst])

The second argument, [Match] should be acAnywhere in order to get the "Any
Part of Field" for the Find dialog window.

HTH.

Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.

(Please remove ZERO_SPAM from my reply E-mail address, so that a message
will be forwarded to me.)


JP Martinez said:
When you said use "acAnywhere" as the second argument you mean for the
following below:

DoCmd.FindRecord( ) , acAnywhere

I just want to make sure I do the syntax correctly.

thanks

-Pierre

"'69 Camaro" <[email protected]_SPAM>
wrote
in
message Hi, Pierre.

You won't be able to control this setting with VBA 4.0 code (from Access
95), which is what the Button Control Wizard uses.

To apply the search option in VBA code, use the DoCmd.FindRecord( )
method.
Use acAnywhere as the second argument of this method to search in
any
part
of the field.

However, it would probably be easiest if you just changed the default
option
setting for Access. To do so, 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. 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.

HTH.

Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.

(Please remove ZERO_SPAM from my reply E-mail address, so that a message
will be forwarded to me.)


I have a "Find" command on a form that I created using the built in
control
wizard -how do I make it so that when
it comes up one of its fields changes to "Any part of field"

Thanks in advance.

-Pierre
 
Top