![Access 2007 filter subform using combo box in vba function Access 2007 filter subform using combo box in vba function](/uploads/1/2/5/4/125459523/163389086.jpg)
![Access 2007 Filter Subform Using Combo Box In Vba Access 2007 Filter Subform Using Combo Box In Vba](http://www.iaccessworld.com/wp-content/uploads/edd/2014/12/part-2-combobox.png)
I thought this would happen automatically and without VBA, but maybe not. If you want a change in the combo box to change the subform records to the linked records then simply link the subform to the combobox. In the subform control link the master and child fields like. Access Subform won't update with combobox change bcooler. Filtering microsoft access records based. Use RecordSource. Create a combo box either with entered. Event to dynamically filter the RecordSource of subform. You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands. Old February 8th, 2007, 12:30 AM.
I wish to filter records on subform (continuous) using the value in a combo box on data entry parent form, once the combo box has a selection, however, have no filter/link prior to this. Essentially, the subform has all the lessons for the year. This subform is 'complimentary' in a manner of speaking, because it helps the person who is creating a new lesson on the parent form (data entry mode), because the person can avoid duplicating a lesson.
Here we go: The parent form has a text box (for the name of the lesson), and the combo box is for the category (a pre-defined list of categories). When teh name and category are entered, I wish to have the subform list only the lessons in that same category. This won't work: Private Sub ParentFormCategoryComboBoxAfterUpdate If Me.ParentFormCategoryComboBox IsNull Then Do Not Filter Me.Subform Else Me.Subform.categoryID =Me.ParentFormCategoryComboBox End Sub. In that case I'd use the AfterUpdate event of the combo box to set the subform's Filter property. Base the subform on a query showing all categories; in the combo box's AfterUpdate event put code like Private Sub cboCategoryAfterUpdate On Error GoTo ProcError If IsNull(Me.cboCategory) Then Me.subformname.Form.Filter = ' Me.subformname.Form.FilterOn = False Else Me.subformname.Form.Filter = 'CategoryID=' & Me.cboCategory Me.subformname.Form.FilterOn = True End If ProcExit: Exit Sub ProcError: MsgBox 'Error ' & Err.Number & ' in setting subform filter:' & vbCrLf & Err.Description Resume ProcExit End Sub John W.