Forum Home
Press F1
 
Thread ID: 68706 2006-05-08 08:44:00 Access Searches Dannz (1668) Press F1
Post ID Timestamp Content User
453189 2006-05-08 08:44:00 Hi All,

I have an access database for an auction im going to help run.

We have a form which has the bidders details.

I currently have 2 buttons on the form.

Both open the Find box that is called from the edit menu.
It sets the focus on 2 of the fields (Surname and Business Name)
At the moment we have no way of setting so that it doesnt search for whole words, as the default for the find box in access is whole field.

Is there either a function or some code that will allow us to search for and find part of either busniness names or surnames and go to that record -- it needs to be a button on the form.

Cheers
Dannz (1668)
453190 2006-05-08 10:41:00 Hi Daniel

When using the standard find / search features in Access, you can use wildcard characters like this :

Peter* will find Peters as well as Peterson
*Mar* will find Mary as well as Marigold

And you can also specify whether you want a full or partial match. This might do what you want, if not then you can get the same effect with queries and using wildcard characters in the query criteria. Let me know if you want to know how to do that or whether the * is all you need.

HTH, Andrew
andrew93 (249)
453191 2006-05-08 21:24:00 when i put the wildcard in it only finds records with one "wildcard" character not infinite.

I need it from the button on a form so im not sure if a query would work...


Cheers
Daniel
Dannz (1668)
453192 2006-05-09 06:36:00 Hi there Daniel,

I am not an expert in Access, most of what I know now has been learned in the last month! If you can write what you are looking for as a query you could write some vb code to do what you want. Its more complicated, let me know if you're keen.

Also I'm not exactly clear on what you want to do. I'm guessing that there are some textboxes on the form which the user enters partial matches to records in and then presses a button? Or have I got it all wrong?

Regards
pico (4752)
453193 2006-05-09 06:58:00 You are partly Correct.

There is a form which has peoples contact details in - ie business, name, address etc.

I want to be able to search for records by partial business name and also by partial surname

so ie if i click on search by surname and put in "jo" - i would want the search to find a surname like "jones"
Dannz (1668)
453194 2006-05-09 07:52:00 The LIKE condition with % as a wildcard should give you what you're looking for if you are building a SQL query to use on the database.
More here (www.w3schools.com).
Antmannz (6583)
453195 2006-05-09 07:55:00 People seem to misunderstand me.

All i want is to be able to use a function similar to the FIND MENU function in access but make it match any part of a field and not the "Whole Field" which is the default.

I dont want to do queries or sql or anything like that.

Saying that, thanks to all the people that have replied.
Dannz (1668)
453196 2006-05-09 11:32:00 Hi Daniel

I think my first post has the answer you are looking for (after reading your later posts), but what do you mean by this :


when i put the wildcard in it only finds records with one "wildcard" character not infinite.

The example you gave is very like mine. If you use the standard find function on the edit menu (per your first post) and enter jo* into the search box, you will find everything starting with 'jo'. If you want to find all instances of 'jo' anywhere within a field, then you enter '*jo*'. However, if you are referring to searching many fields with the same search term, then you will need to revert to query (aka SQL) or VBA if it is overly complex.

Andrew
andrew93 (249)
453197 2006-05-10 08:55:00 Ive managed to find a way -- wildcard filters with VBA.
Using a message box to get the search/filter criteria

Thanks to all that have replied.
Dannz (1668)
1