Search Defaults

P

Paul

I have a command button set to search my data (form view), when this
is clicked the default settings are for the current field I am in and
for the whole word. Users then need to change this to search all
fields.

When clicked I would like the default to be
Look in: all data (table)
Match: Any part of field
Search: All

Thanks for any help
 
J

Jerry Whittle

Check out Application.SetOption. Below are some I used in A97 databases.

'Set some database defaults found in Tools, Options
' Put in the Open event of the startup form
' Set Default Locking to Edited Record
Application.SetOption "Default Record Locking", 2
' Set Default Open Mode for Databases to Shared
Application.SetOption "Default Open Mode for Databases", 0
' Set Default Find/Replace Behavior to Start of Field Search
Application.SetOption "Default Find/Replace Behavior", 2

Application.SetOption "ShowWindowsInTaskbar", True

In the case of "Application.SetOption "Default Record Locking", 2" Default
Record Locking has three choices and the one I want is the third so, of
course, I put in 2 for the arguement. That's because it starts numbering at 0
instead of 1.

Put the above code in the Open Event of your opening form. One other strange
thing is that the database may need to be opened and closed twice on the
user's computer for the change to take effect. The first time the database
opens, it makes the changes. The second time the changes are in effect.
 
P

Paul

Check out Application.SetOption. Below are some I used in A97 databases.

'Set some database defaults found in Tools, Options
' Put in the Open event of the startup form
    ' Set Default Locking to Edited Record
    Application.SetOption "Default Record Locking", 2
    ' Set Default Open Mode for Databases to Shared
    Application.SetOption "Default Open Mode for Databases", 0
    ' Set Default Find/Replace Behavior to Start of Field Search
    Application.SetOption "Default Find/Replace Behavior", 2

Application.SetOption "ShowWindowsInTaskbar", True

In the case of "Application.SetOption "Default Record Locking", 2" Default
Record Locking has three choices and the one I want is the third so, of
course, I put in 2 for the arguement. That's because it starts numbering at 0
instead of 1.

Put the above code in the Open Event of your opening form. One other strange
thing is that the database may need to be opened and closed twice on the
user's computer for the change to take effect. The first time the database
opens, it makes the changes. The second time the changes are in effect.
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.







- Show quoted text -

Thanks for the info. Works great
 

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