Solved

Setting default column to search in MS Access 2003 with "General Search" enabled?

Posted on 2011-03-13
3
404 Views
Last Modified: 2013-11-27
Hi,
My client wants me to customize the search function in the MS Access 2003
database I set up for him to default to a specific column (the "Look In" field) AND have
a General search option.

First he wanted me to set it to "Any part of Field". That was no problem, just go
to the menu, options --> Edit/Find tab, and set the value to "General search". Ok, so
far, so good....

Problem is , the Search window defaults to the entire table in the "Look In" field, so he has to click
on that drop-down and select the column (which would only be the second choice
if the cursor is focused in the field he wants to search in). But he does this hundreds of times
a day, so...

He wants to have both the General Search (any part of field) and "Look In" default to one column
in the table. Is this possible? Do I have to to edit the Search's event procedure VB (If so, I'm clueless)

Can anyone help me out?

Jim

PS:  the VB for the Search is as follows, if I need to edit something in there to make this happen,
please specify:

Private Sub Find_the_part_Click()
On Error GoTo Err_Find_the_part_Click


    Screen.PreviousControl.SetFocus
    DoCmd.DoMenuItem acFormBar, acEditMenu, 10, , acMenuVer70

Exit_Find_the_part_Click:
    Exit Sub

Err_Find_the_part_Click:
    MsgBox Err.description
    Resume Exit_Find_the_part_Click
   
End Sub


THANK YOU to anyone who can help!
0
Comment
Question by:jfstanley
  • 2
3 Comments
 
LVL 84

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 500 total points
ID: 35123217
That's the nature of the builtin search feature. If you want more functionality you'll have to code that yourself. It can be done, but search functionality can get exceptionally involved.

Many applications have a search form that user can work with to locate records. The form consists of several different controls (textboxes, combos etc) which allow the user to select their criteria, and then a couple of buttons to allow them to actually do the search. Some search facilities show the results in a listbox, others just interact directly with the form (i.e. set the Form filer, or the Form Recordsource, etc etc).

I hate to say it, but if you're "clueless" about VBA and such, then you're probably going to have a difficult time with this.
0
 

Author Comment

by:jfstanley
ID: 35123258
So basically i would need to contract someone to code me a whole new search form to do
what my client wants... there's nothing i can do with that VB that I pasted at the end of my
message to make it happen?...ok, fair enough. Thanks.
0
 
LVL 84
ID: 35124060
That's right. The code you posted just invokes a menuitem (it's no different than clicking a button on the menu).
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Most if not all databases provide tools to filter data; even simple mail-merge programs might offer basic filtering capabilities. This is so important that, although Access has many built-in features to help the user in this task, developers often n…
When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now