I can\'t figure this out , after hours of trying different things. I have a sear
ID: 3560387 • Letter: I
Question
I can't figure this out , after hours of trying different things.
I have a search function that works fine for partial matches to a list box criteria but I need it to only return exact matches. It's too hard to explain so I attached the file here via drop box.
The search form is "frmSearch".
If you open this you will see two control buttons:
Filter to Partial ----This works FINE!!
Filter to Exact ----This doesn't work :(
If I select Niger from the list box ----the results show Niger and also Nigeria.
I want to filter to Niger exactly.
Any help would be greatly appreciated!
Thanks
Explanation / Answer
Those buttons initiate a return of a recordset based on a query. The query has a WHERE condition that provides the filtering. The problem is that the first one uses an asterisk (e.g. *) as as wildcard so that everything that begins with the variable is returned. You need to duplicate that query and remove the asterisk so that the filter only looks for exact matches. When you have removed the asterisk, save the new query and change your Filter to Exact button so it uses that.
It will look something like this:
<first part of the query> WHERE [fldCountry] LIKE myForm!selCountry & "*"
Just remove the part that adds the asterisk on the end.
<first part of the query> WHERE [fldCountry] LIKE myForm!selCountry
Save it as a new query and use that on the Filter to Exact button
dear
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.