MS Access Wildcard Search Query (1 Viewer)

cdawley4

New member
Local time
, 18:11
Joined
Sep 13, 2004
Messages
5
Hi,

I am modifying a database and I want to create a Wildcard Search Query in MS Access. The database has city and the state they reside in. I have about 500 records. I want to see the records that contain Miami anywhere in the record. I also want a dialog box to pop up so I can search for it. I also want to have a wildcard search so I can narrow the search down and find records that have Mia* and still pull up Miami records. I have seen this done on other databases but not sure how it is done. Please help.

Thanks,

Chris
 

Ukraine82

Registered User.
Local time
, 18:11
Joined
Jun 14, 2004
Messages
346
Make a query base on your table that you wish to search. Select a city field, place Like [Enter City Name] in the criteria that you wish to search for.

When searching a record be sure to use the * after the text. Ex: Miami*, Orlando*, and etc....

hth,

michael
 

paulcraigdainty

Registered User.
Local time
Today, 02:11
Joined
Sep 25, 2004
Messages
74
This is what I want to do however do not really understand the response. I need to be able to search a table based on the value entered into a text box. However similer to the above problem and need the results to be limited. I have a table with only one field with records that appear like this:

Lancashire.lancs.blackpool.uk
Lancashire.lancs.preston.uk
Lancashire.lancs.burnley.uk
Manchester.man.hulme.uk
Manchester.man.cheadle.uk
Glasgow.glw.city.sco
Edinburgh.edi.crewetoll.sco

I want my users to be able to enter their search criteria into a text box on a form. The user however might need to choose from all locations in Lancashire, in this case I want my user to be able to enter Lancashire% and the results show all records that start with Lancashire. I need these results to be outputed to a list box so that my users can select the relevant one.

Can anyone expand on the above?? Thanks
 

paulcraigdainty

Registered User.
Local time
Today, 02:11
Joined
Sep 25, 2004
Messages
74
I have worked out that the following query should do the job, however it doesn't:

SELECT tblSTC.STC, *
FROM tblSTC
WHERE (((tblSTC.STC) Like forms!frmsearch!txtsearch));

This produces no results ??
 

Jon K

Registered User.
Local time
Today, 02:11
Joined
May 22, 2002
Messages
2,209
SELECT tblSTC.STC
FROM tblSTC
WHERE (((tblSTC.STC) Like [forms]![frmsearch]![txtsearch] & "*"));
.
 

Users who are viewing this thread

Top Bottom