Search button - possible to make default options applicable on all computers? (1 Viewer)

HGCanada

Registered User.
Local time
Today, 11:17
Joined
Dec 30, 2016
Messages
82
I have a database which will have multiple users. They will enter and view data on a form, which also has a sub-form on it. The form header has a "Search" command button. I know it's possible to change MS Access options on each user's computer, to specify the search options. However, is there a way to set these options so that, each time any user uses that search button, regardless of the MS Access options on that computer, the search is conducted such that:

1) it searches for any part of a field, and
2) it searches the entire current document, and
3) it searches in the main form, and not the subform?

Sometimes people search when they happen to have the cursor in the sub-form, and then it doesn't actually search the main form at all, so they don't understand why that search doesn't work.

Thanks in advance!
 

Minty

AWF VIP
Local time
Today, 16:17
Joined
Jul 26, 2013
Messages
10,371
If the search command button is coded using VBA you are pretty much in complete control of what and how it searches.

What is the code called by the button ?
 

isladogs

MVP / VIP
Local time
Today, 16:17
Joined
Jan 14, 2017
Messages
18,216
Agree with Minty though you can also set startup properties that apply when your db is opened on any computer.

I use that approach for a number of properties though not for the ones you mentioned
 

gemma-the-husky

Super Moderator
Staff member
Local time
Today, 16:17
Joined
Sep 12, 2006
Messages
15,653
Do you have multiple users sharing the same database, or do they have separate copies?
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 23:17
Joined
May 7, 2009
Messages
19,237
how do you run the "Search", is it

DoCmd.RunCommand acCmdFind

if that the case, you can shift
the Focus to the main form
before executing that command
Code:
Private Sub Command34_Click()
    Me.SetFocus
    DoCmd.RunCommand acCmdFind
End Sub

the above is point 3.

point 1 can be set when the
search window appears.

point 2, not possible. it will
search the entire table.
 

missinglinq

AWF VIP
Local time
Today, 11:17
Joined
Jun 20, 2003
Messages
6,423
What, exactly, do you mean by

"it searches the entire current document"

'Document' makes one think of Word, rather than Access. Are you saying that you want to search every Control on the Record? Or are you trying to search a given Control, such as a Memo Field Control?

Also, you can set Options, as ridders mentioned, that appear in the Options section of Access...but I can find none for setting options that appear in the Search dialog box, as you're trying to do.

Linq ;0)>
 
Last edited:

jdraw

Super Moderator
Staff member
Local time
Today, 11:17
Joined
Jan 23, 2006
Messages
15,379
As others have said, what exactly are you trying to search?
What is the purpose of the subform since it appears to be the source of confusion?
Can you give readers a sample search -in plain English -telling us what they are looking for, and what is suppose to happen if a) a match is found and b) no match.
 

Users who are viewing this thread

Top Bottom