Forums
This topic is locked
Search with multiple fields
Posted 05 Oct 2004 12:23:47
1
has voted
05 Oct 2004 12:23:47 Johan Arvidsson posted:
Hi,I'm working on a, probably, quite simple search but I can't get it work. I have a search page with a form. The form has five fields. Each field will do a search in a special column in the Access-database. I have written the recordset as shown on the picture at <img src="www.menhir.se/kvarn/delar/Postuppsattning.jpg" border=0>. Only two search fields are included on the image.
If I search for a special value in both fields everything will work, but if I only search for one value and leave the other search field empty it will give 0 search results. Why?
Thanks,
Johan
Replies
Replied 06 Oct 2004 18:03:31
06 Oct 2004 18:03:31 kit allen replied:
Hi,
What you need to do is make the search constrains a little less rigid. Change this line:
WHERE Status_allmanet = 'MMColParam' AND Typ_av_hatta = 'MMTak'
to:
WHERE Status_allmanet LIKE '%MMColParam%' AND Typ_av_hatta LIKE '%MMTak%'
Hope that does the trick...
K
What you need to do is make the search constrains a little less rigid. Change this line:
WHERE Status_allmanet = 'MMColParam' AND Typ_av_hatta = 'MMTak'
to:
WHERE Status_allmanet LIKE '%MMColParam%' AND Typ_av_hatta LIKE '%MMTak%'
Hope that does the trick...
K