If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Filter Combo boxes using Visual Basic
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 |
#2
|
|||
|
|||
Filter Combo boxes using Visual Basic
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 -- Daryl S "azza" wrote: 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 |
Thread Tools | |
Display Modes | |
|
|