Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating search function same as the search button in class searchform

Status
Not open for further replies.

jerold

Programmer
Aug 30, 2000
52
PH
Hello!
I would like to create a form with search capability.
I have a source of predefined fields in a combo box to be
searched. How would I create a search button that would search the records with the criteria of combination of the fields/options selected. I have created checkboxes for the fields to be searched.
 
Are you searching all of the checked fields for the same value, or does each checked field have its own value to search for?

Basically, the approach is that in your cmdSearch.Click you'll have a whopping CASE construct that looks to see which fields are checked, then build an SQL SELECT command string programmtically. After examining the possibilities and building your search string, you execute the search string with DoCmd or macroing.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top