Filter Combo boxes using Visual Basic

  • Thread starter Thread starter azza
  • Start date Start date
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
 
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
 
Back
Top