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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Adding options to a filter

Status
Not open for further replies.

jerry23

Technical User
Jun 14, 2002
7
US
Hi guys. I'm working on a payroll form that lets people right click on a field, like name, and filter all records for those with a particular name on it. When they right click, they have the option to type in what they want to filter for( filter for_____) Is there any way to make that "filter for" field into a combo box that queries a table for values.

 
Sure,

Setup a combobox add all of your choices...
Now in the after update box of your combo box do this.

Dim strCmb as String
Set strCmb = comboBox ' this sets the string equal to whatever text is in that combo box

If ComboBox = "No Filter" Then ' make an option for no filter as the first (default) value
Exit Sub
Else
Filter For strCmb '? <---(change) run your filter for and type strCmb as the filter - I'm not sure what the command line is
End If

Make sense?

-Josh ------------------
-JPeters
Got a helpful tip for Access Users? Check out and contribute to 'How to Keep Your Databases from becoming Overwhelming!'
thread181-293590
jpeters@guidemail.com
------------------
 
Jerry, I have a sample DB up on my website that shows a continuous form, and performs FILTERING based on any field-content click, and sorting based on any field-LABEL clicks. It's a very simple technique, it might give you some ideas as well.

Here it is:


Jim Me? Ambivalent? Well, yes and no....
Another free Access forum:
More Access stuff at
 
Awesome...

Thanks jpeters, jim... helped a lot.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top