Find Record Button Question

J

Jon

Hi,

I'd be grateful for some help. I'm using Access 2003.

I've created a button on a form to find a record in my db, using the wizard,
based on a person's surname.

Looking at the VB under "Build Event" the code shows the following:

Private Sub Find_Surname_Click()
On Error GoTo Err_Find_Surname_Click
Forms!frm_All_People!Surname.SetFocus
Rem Screen.PreviousControl.SetFocus
DoCmd.DoMenuItem acFormBar, acEditMenu, 10, , acMenuVer70
Exit_Find_Surname_Click:
Exit Sub
Err_Find_Surname_Click:
MsgBox Err.Description
Resume Exit_Find_Surname_Click
End Sub

However, when the "Find and Replace" box opens, the "Match" field displays
"Whole Field" whereas I would like it to display "Any Part of Field".

What should I add to the code to do this.

Thanks

Jon
 
L

Linq Adams via AccessMonster.com

The simplest way to do this is thru Options. Go to

Tools - Options - Edit/Find - Default Find/Replace Behavior

and change

"Fast Search"

to

"General Search."

Important Note: You'll then have to close Access down then re-open it for the
change to take effect.
 
J

Jon

Thanks Linq,

That does the trick in part. However, it then over-rides the "SetFocus" on
the surname field. I appreciate this is not a major issue, but this db will
reside on a network server and a number of people will access via their own
PCs. My apologies, I didn't think to mention that bit. Am I correct in
thinking your option will only work on machines that are set up as you have
suggested?

Ideally I'd prefer to drive this through the form coding, so hopefully that
is possible, or any alternative that does not rely on the user to have to
change options.

Thanks

Jon
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top