Search Form to search everything

D

dgodfrey

Here is a silly question.

Is there an easy way to enter a single search term in a text box and have
Access search every field (control, etc.) for matching results
"automagically" as the saying goes? Some sort of wildcard, maybe?

For example, a user enters a Driver's License # or a last name. Access then
returns a list of all records that have that particular name or number or
whatever. Kind of a blind search, because they have insufficient information
to search any particular field by name or whatever. They have been given one
piece of information...say for example an even more broad search...they want
to find all white females in the database. Instead of having to have these
two fields represented on the search form by combo boxes, just enter "White
Female" and it comes back with 10 records that pertain to a white female.

I hope this makes sense and can it be done? Should it be done?

Thanks.
 
K

KARL DEWEY

I did not complete the process but this will get you started.
Create a union query pulling the primary key field and each and every field
you want to search. Then use it in a second query.
What I did not finish was to parse the input information entered in the
prompt [Enter words].

QRY Full_Search1 --
SELECT YourTable.ID, YourTable.PA AS SOME
FROM YourTable
UNION ALL SELECT YourTable.ID, YourTable.PDX AS SOME
FROM YourTable
UNION ALL SELECT YourTable.ID, YourTable.Tot_PA AS SOME
FROM YourTable
UNION ALL SELECT YourTable.ID, YourTable.Power AS SOME
FROM YourTable
UNION ALL SELECT YourTable.ID, YourTable.Product AS SOME
FROM YourTable;

QRY Full_Search2 --
SELECT YourTable.ID, YourTable.PA, YourTable.PDX, YourTable.Tot_PA,
YourTable.YourDate
FROM YourTable, Full_Search1
WHERE (((Full_Search1.ID)=[YourTable].[ID]) AND ((Full_Search1.[SOME]) Like
"*" & [Enter words] & "*"))
GROUP BY YourTable.ID, YourTable.PA, YourTable.PDX, YourTable.Tot_PA,
YourTable.YourDate;
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Search Form 3
Access 2007 Search Form 2
Search form 1
Search field 1
Continuous form search problem 5
Major search task 4
Create A Search 5
Code for "OK" in Dialog Box to lead to selected records in Form Vi 1

Top