Hi,
I am trying to use an unbound Combobox in a form to filter my result that is shown in a form. The form contains data from three different table and I want to filter result on a specific field with a value, e.g only show fruits.
I can easily to do this with a parameter, I just put [Enter criteria] in design view for the field I want to filter on. But this method is not ideal since the user could easily misspell and has to rerun form if he/she wants to change this value.
I have now put a Combobox in my form which I populate with data that user may filter on.
I build an expression in design view for my form on the field I want to filter on, looking like this.
[Forms]![frmMyData]![MyComboBox]
I enter event handler in properties for my Combobox and creates a macro after update looking like this.
Private sub MyComboBox_AfterUpdate()
DoCmd.OpenQuery "qryMyData"
DoCmd.OpenForm "frmMyData"
End Sub
But nothing happens. Shouldn't query filter on what's in my Combobox and form show data that query generates? With nothing, I mean that query doesn't contain any data.