Using wildcard in a search function??

Mrs.Meeker

Registered User.
Local time
Today, 19:56
Joined
Mar 28, 2003
Messages
172
Using wildcard in a combo box search function??

I have a form with a combo box to search (by county) on it. The problem is that the data may be listed by multiple counties and the search is by single counties. There are 99 counties listed. The data comes from a different source and the counties could be listed in a multitude of ways. If I search for Warren County. I'd like to get Warren County as well as anything like Warren, Jefferson or Jefferson, Warren. There may be 3 or even 4 counties grouped together. This is the code I used on the button. Can I tweak it to gather all projects that have a certain county anywhere in the cell?

stLinkCriteria = "[County]=" & "'" & cmbCounty.Value & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria

Thanks
Rhonda
 
Last edited:
stLinkCriteria = "[County]=" & "'" & me.County & "'"

??
ken
 
sorry that didn't work - it broke it :o
 
Sorry:

stLinkCriteria = "[County]= '" & me.cmbCounty & "'"


???
ken
 
I re-edited post 4, did you try the revision?

ken
 
I tried again. It still doesn't work. It only brings up the files with the single county name and not multiple county names.
 
Would 'Warren, Jefferson" be stored in a single field?

example:

fieldCounty
Warren
warren
Jefferson
Warren, jefferson
jefferson, warren


ken
 
Yes, that is my quandary. The planners assign the projects and if the project crosses a county they may list one, two or all of them. If I seach for one of those counties I would like these projects to show up as well.
 
I figured this out!!!

I took my left handed brain and turned it around to take another approach!!!

I created a new query called QryCmbCountySearch. I used my tblProjectMaster, used County and Group by and made this the Row Source for my combo box.

This table contains the counties as they are displayed by the planners so now nothing will be missing.

Hope this makes sense. :D

Rhonda
 

Users who are viewing this thread

Back
Top Bottom