Setting Edit/Find Default on Form Open

K

Kathleen

I want to set the Application Option for the "Default Find / Replace
Behavior" to "General Search".

I want to set it when I open the main form of the DB - so I want to attach
it to the "On Open" event on my main DB form.

What code do I put where? I'm a beginner - so be kind and be complete
please. I've read other posts that help write the single line of code
needed - but I don't know whether to put it into an expression or a macro or
code..... I really need a complete answer on this one - I'm chasing my tale.

Kathleen
 
M

[MVP] S.Clark

Open form in design view
Open Property Window (View / Properties)
Click where the two rulers meet(Square) to select the form properties
Click on the tab 'Events'
Locate On Open
Select "[Event Procedure]" from the Combobox for the property.
Click on the ... button

Copy and paste your code into that module
 
K

Kathleen

Great - but now I'm getting a compile error on my code. Is my syntax
incorrect?

Private Sub Form_Open(Cancel As Integer)

Application.SetOption("Default find/replace behavior", 2)

End Sub




Kathleen



[MVP] S.Clark said:
Open form in design view
Open Property Window (View / Properties)
Click where the two rulers meet(Square) to select the form properties
Click on the tab 'Events'
Locate On Open
Select "[Event Procedure]" from the Combobox for the property.
Click on the ... button

Copy and paste your code into that module

--
Steve Clark, Access MVP
http://www.fmsinc.com/consulting
*FREE* Access Tips: http://www.fmsinc.com/free/tips.html

Kathleen said:
I want to set the Application Option for the "Default Find / Replace
Behavior" to "General Search".

I want to set it when I open the main form of the DB - so I want to attach
it to the "On Open" event on my main DB form.

What code do I put where? I'm a beginner - so be kind and be complete
please. I've read other posts that help write the single line of code
needed - but I don't know whether to put it into an expression or a macro
or
code..... I really need a complete answer on this one - I'm chasing my
tale.

Kathleen
 
Top