Filtering Using Combo-Box (1 Viewer)

Cavern

Registered User.
Local time
Today, 01:27
Joined
Jul 12, 2002
Messages
31
Hello.. I'm just getting a handle on all this Access stuff (thanks mostly to these kickass forums :) )... And I've run across a little problem...
I'm updating a database that stores information on various companies, and the table that stores the company info has a field called [Company Sector] which contains one of 'Industry' or 'Service'..
Now the trouble: I have a form setup to view the information for the companies, but my boss wants me to have a way of filtering out either all the Service or all the Industry buisnesses. I can't for the life of me figure out how to do this.. I've got a combo-box setup on the form with the two options (thats How I'd like to select it), but I can't figure out how to get it to set the filter...
I'm guessing there's a bit of code I can stick into the 'After Update' field, but I'm not sure what I should be setting..

If soemone could either gimmie a hand setting this up, or point me in the right direction for an answer that'd be great...
Any help for an Access Newbie would be much appreciated!
-Thanks
 

fernin8r

Registered User.
Local time
Today, 01:27
Joined
May 28, 2002
Messages
142
Yeah...I think you just need a DoCmd.ApplyFilter on you AfterUpdate for the combo Box

DoCmd.ApplyFilter ,"[Company_Sector]=Me!ComboBox"
 

fernin8r

Registered User.
Local time
Today, 01:27
Joined
May 28, 2002
Messages
142
You might need to write it like this

DoCmd.ApplyFilter,"Company_Sector = '"& Me!ComboBox &"'"
 

Cavern

Registered User.
Local time
Today, 01:27
Joined
Jul 12, 2002
Messages
31
Yeay!!! It worked :)
Thanks a lot.. I really appreciate it....
 

Users who are viewing this thread

Top Bottom