Search multiple fields
am 04.04.2008 17:17:42 von Alex Pavluck
Hello. I need to search 6 different fields for a key word. The way I
normally query data is in a single field with the critera: Like '*' &
[ENTER Keyword] & '*'. Is there a way to enter only 1 key word but
display the records that contains that word in any of the 6 fields?
Ex
PERSON GRANT1 GRANT2 GRANT3...
Jim "Smoking is fun" "_blank_" "Access database development"
Tom "_blank_" "SQL is great" "Stop Smoking now"
etc.
If I search for "Smoking" I will find both Jim and Tom even though the
keyword is in different grants.
Thanks!
Alex
Re: Search multiple fields
am 04.04.2008 17:29:26 von Allen Browne
In query design view, you can repeat the exact same parameter under multiple
fields.
But the real problem here is that you are not using the power of the
relational database. It appears that one person can have multiple grants.
This should be represented with a 2nd table where you can have muliple grant
*records* related to the one person, instead of having multiple *columns* in
the one table.
For more information about his basic one-to-many approach, search on the
word 'normalization.' Here's a starting point:
Relationships between Tables (School Grades example)
at:
http://allenbrowne.com/casu-06.html
For a bit more detail, here's a PDF:
http://allenbrowne.com/bin/Access_Basics_Crystal_080220_Chap ter_03.pdf
And for some further reading, here's a bunch more links to this crucially
important topic:
http://www.accessmvp.com/JConrad/accessjunkie/resources.html #DatabaseDesign101
--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
"Alex Pavluck" wrote in message
news:bf964af5-9759-4fe2-9b58-9123e9948546@m3g2000hsc.googleg roups.com...
> Hello. I need to search 6 different fields for a key word. The way I
> normally query data is in a single field with the critera: Like '*' &
> [ENTER Keyword] & '*'. Is there a way to enter only 1 key word but
> display the records that contains that word in any of the 6 fields?
>
> Ex
> PERSON GRANT1 GRANT2 GRANT3...
> Jim "Smoking is fun" "_blank_" "Access database development"
> Tom "_blank_" "SQL is great" "Stop Smoking now"
> etc.
>
>
> If I search for "Smoking" I will find both Jim and Tom even though the
> keyword is in different grants.
>
>
> Thanks!
> Alex