Filter Combo boxes using Visual Basic

A

azza

I am trying to apply a filter to my combo box using Visual Basic in Access
2007.
The ultimate aim is for the combo box to update after applying a filter to
the whole form using buttons - Show All or Show Current (Which is my currrent
members).
The form opens with the default of Show Current.
I have been playing with various forms of the following.
DoCmd.ApplyFilter , "current = True"
&
me.refresh
Even if I could just get the combo box to refresh after filtering the main
form with the new selection that would be great. Whatever way works.

Thanks
 
D

Daryl S

Azza -

Replace the row source with the SQL statement that has the filter in the
SQL. Something like this:

Me.lstBoxName.RowSource = "SELECT fieldname FROM tablename WHERE
filtercriteria"
Me.lstBoxName.Requery
 

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