Filter List Box from command button

Dear Experts

Using Access 2010 I am trying to produce an interactive demonstration of data to clients who are interested in staffing numbers and details across Europe.  Rather than using visio / power point I am using access so I can reuse this time and again with the end user simply producing excel spread sheets in the right format that get imported / linked into access.

I have produced a map which resides in a form, using transparent command buttons when the user clicks on a country a list box pops up with the names of their competitors.  That was the easy part - I am keen to apply a filter to the list box from that command button.  

The list box is called “Offices” and contains 2 fields:  “Company” and “Country”. (“Country” is hidden from view).  So for example when I click on Spain the list is filtered by all companies whose “Country” = “Spain”

Can anybody help?
correlateAsked:
Who is Participating?
 
Rey Obrero (Capricorn1)Commented:
in the click event of each button, place this

private sub btn_click()
me.offices.rowsource="select company,country from tablex where country=" & chr(34) & me.btn.caption & chr(34)


end sub
0
 
correlateAuthor Commented:
That's fantastic - thank you and thank you for a record breaking response
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.