HELP,how to show search result according to specifed criteria and selected fields

K

Kortrijker

Dear all,

I'm designing an interface for searching, but I don't know how to show the
result based on criteria and selected fields. For search criteria, I also
want to know how to active fuzzy search, for instance, if I only type
'country=U', the search result would show U.K, USA and Ukrane.

First of all, I have a data table (transferred directly from SQL server
database) and an userform, in this userform, I could choose which field I
want to show (2 listboxes, when I click fields in left listbox, they will be
shown in right box, I want to only show these seleced fields ),

Secondly, I could also make criteria for search in this userform, this part
is made of 1 listbox, 3 comboboxes and 2 textboxes.
1. one listbox to show final criteria results
2. 3 comboboxes, two of them show criteria name, like 'equal', 'all' , 'more
than'. one shows logic relationship, like 'and', 'or '
3. 2 textboxes, I can input value or text inside,
4. 2 combobox and 2 textboxes combine together to make expression, like
value more than 5, country equal to u.k, another combobox shows logic
relationship between 2 criteria

Please give me some suggestion or tips, thanks a lot.

If you are interested, please leave your Email address, I'll send you the
sample ASAP.
 
T

Tom Ogilvy

Use an autofilter from the data menu.

You can set the criteria with code using your userform results.

Turn on the macro recorder and apply the filter manually, -- in the dropdown
of the filter, select custom and you will be able to use criteria like
Begins with, contains, greater than and so forth.

Turn of the macro recorder when done and you can modify the code to build
the criteria based on the userform values.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top