defaulting find box

G

Guest

I have a form with three fields. When I click the find button I want to
default to run a search to match any part of the FIRST field but it keeps
defaulting to the third field even though the first field is first in the tab
order
Is it possible to change the default behaviour of the find button to specify
which field to search and that it should always default to match any part of
field?
 
G

Guest

Was this find button created by the wizard? If so, you need to change the
code behind it. Replace the Screen.PreviousControl.SetFocus to
Me![controlname].setfocus. To do this open the form in design view, click on
the find button, right click and select properties, click the event tab,
click by the [event procedure], click the three dot icon tha will appear at
the end of that line, and repalce the code. You can also get the control
name by pulling up the properties for the control you wan and select the all
tab and find the name.
 
G

Guest

Hi aand thanks for that but I still have the problem.
Basically the first field is called Topic and the third field is called
information. I'm storing keywords in the topic field and all the detailed
information about them in the information field. When I click the Find button
the Look In field always defaults to the Information field and not the topic
field. I want it to default to the Topic field



schasteen said:
Was this find button created by the wizard? If so, you need to change the
code behind it. Replace the Screen.PreviousControl.SetFocus to
Me![controlname].setfocus. To do this open the form in design view, click on
the find button, right click and select properties, click the event tab,
click by the [event procedure], click the three dot icon tha will appear at
the end of that line, and repalce the code. You can also get the control
name by pulling up the properties for the control you wan and select the all
tab and find the name.

Tara Keane said:
I have a form with three fields. When I click the find button I want to
default to run a search to match any part of the FIRST field but it keeps
defaulting to the third field even though the first field is first in the tab
order
Is it possible to change the default behaviour of the find button to specify
which field to search and that it should always default to match any part of
field?
 
G

Guest

Are you using a button that was created on the form or from the menu bar
opening edit / find? The method below describes how to change a button that
was added to the form to find a record. If you are going through the menu
bar it behavior is that it searches in the last control that as active. You
could also create a queary based on an unbound text box with the criteria
Like("*" & Forms![FormName]![ControlName] & "*") or if you do not want to use
a form Like("*" & [Prompt for find value] & "*") and when you run the query
it will prompt you for the parameter. This method will give you the full
list.

Tara Keane said:
Hi aand thanks for that but I still have the problem.
Basically the first field is called Topic and the third field is called
information. I'm storing keywords in the topic field and all the detailed
information about them in the information field. When I click the Find button
the Look In field always defaults to the Information field and not the topic
field. I want it to default to the Topic field



schasteen said:
Was this find button created by the wizard? If so, you need to change the
code behind it. Replace the Screen.PreviousControl.SetFocus to
Me![controlname].setfocus. To do this open the form in design view, click on
the find button, right click and select properties, click the event tab,
click by the [event procedure], click the three dot icon tha will appear at
the end of that line, and repalce the code. You can also get the control
name by pulling up the properties for the control you wan and select the all
tab and find the name.

Tara Keane said:
I have a form with three fields. When I click the find button I want to
default to run a search to match any part of the FIRST field but it keeps
defaulting to the third field even though the first field is first in the tab
order
Is it possible to change the default behaviour of the find button to specify
which field to search and that it should always default to match any part of
field?
 
G

Guest

Hi again,
The button was one I added using the Wizard and when you click it it
launches the Find and Replace dialogue box. I tried your suggestion writing a
parameter query and linking it to a button but this returns all results in
datasheet form. I want it to jump from one record to the next in Form view

schasteen said:
Are you using a button that was created on the form or from the menu bar
opening edit / find? The method below describes how to change a button that
was added to the form to find a record. If you are going through the menu
bar it behavior is that it searches in the last control that as active. You
could also create a queary based on an unbound text box with the criteria
Like("*" & Forms![FormName]![ControlName] & "*") or if you do not want to use
a form Like("*" & [Prompt for find value] & "*") and when you run the query
it will prompt you for the parameter. This method will give you the full
list.

Tara Keane said:
Hi aand thanks for that but I still have the problem.
Basically the first field is called Topic and the third field is called
information. I'm storing keywords in the topic field and all the detailed
information about them in the information field. When I click the Find button
the Look In field always defaults to the Information field and not the topic
field. I want it to default to the Topic field



schasteen said:
Was this find button created by the wizard? If so, you need to change the
code behind it. Replace the Screen.PreviousControl.SetFocus to
Me![controlname].setfocus. To do this open the form in design view, click on
the find button, right click and select properties, click the event tab,
click by the [event procedure], click the three dot icon tha will appear at
the end of that line, and repalce the code. You can also get the control
name by pulling up the properties for the control you wan and select the all
tab and find the name.

:

I have a form with three fields. When I click the find button I want to
default to run a search to match any part of the FIRST field but it keeps
defaulting to the third field even though the first field is first in the tab
order
Is it possible to change the default behaviour of the find button to specify
which field to search and that it should always default to match any part of
field?
 

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