Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Real Search Not Parameters 1

Status
Not open for further replies.

jbento

Technical User
Jul 20, 2001
573
US
I would like to create a better search, other than using a parameter in a query. The problem I’m having with this, is that you have to put the exact word in a parameter query to get your answer. For instance, if I wanted to search the database/field for the name Bobby, I would have to put in Bobby, for it to come back with that result. With the parameter, you can’t put in Bo, Bob, or Bobb to find everything close to Bobby. If you do try to do this, it comes back with nothing. Does anyone have code for this? Can anyone help me with this problem? Thanks for any your help.
 
You can change your parameter to this:

Like "*" & [Enter Search Term] & "*"

Then if you enter BO, Access will find all records that have an occurrence of BO in that field.

HTH Joe Miller
joe.miller@flotech.net
 
Hey Joe,
Thank you. I will give this a shot on Monday. I am trying to do this at work.

Jerome
 
Joe,
I just tried in one of my databases at home, and it works. Thank you so much.

Jerome Benton
 
Fro CERTAIN types of string info, there is technique "Soundex", which does a good job of locating 'near' matches to single wiords and short phrases. It was developed by the U.S. Gov. way long ago to sort names on the "Sound Index" of a name. There is a lot of info on the technique available, although most of it is rather old. The process basically reduces the 'english' language to an index on the SOUNDS in the Word(s), so that "Mac" And "Mc" and "Mak" And ... Are all grouped as the same Index value. To use the technique effectively, you need to add a soundex field to the recordsets where you would use the soundex for a look up, and generate the soundex for each record. To look up the name, you would enter the "name" and create the soundex for it and then look up the soundex - but return the actual name(s). It works best when yuu return the list of names which are "near" the soundex, I ususlly use a combobox or list box and have the user pick from this list. If you are just looking up english language names or 'phrases' of three or less words, many of the routines found in the public domain are adequate.

If you need to look up more complex strings, you may need to either modify the standard soundex model or re-think the db structure. The original routines were designed to accrpt ONLY names, without titles, salutations, abreviations, certifications ..., so if you have a "Whole Name" field, the titles (Mr., Mrs., Ms. Dr. ... ) will have a major (NEGATIVE) impact on the soundex indexing, so you would either need to Modify the soundex calculation to remove this 'clutter', or re-design the db to seperate the name field into sub-sets, like title, first name, middle name (Inital), Last name ...

MichaelRed
mred@att.net

There is never time to do it right but there is always time to do it over
 
Is there a way to search an entire database for a paramater or to create a form with all the fields and to type the paramater into the appropriate field and click a button and have it search that field for any records that have a match?

Sharon
 
Hi Joe,

I took a look at this post and am finding your suggesting helpful. I wonder if you (or someone out there) can help me take this a step farther in my database. I want my users to use this type of search to bring up a "subset" of records in a query or form and then select one of those records to be brought up in my main form. How would I go about doing this?

Thanks very much,
Sherry
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top