How do i filter a datasheet when selecting options from a combobox?
How do i filter a datasheet when selecting options from a combobox?
you need to provide details of your form and the datatype of the field you are filtering but assuming you have a main form with a datasheet subform and the combo on the main form is unbound
in vba you assign a 'where' clause to the subform datasheet filter without the 'where' e.g. for a text field
mysubformname.form.filter="[somefield]='" & me.comboname & "'"
mysubformname.form.filteron=true
or for a numeric datatype
mysubformname.form.filter="[somefield]=" & me.comboname
mysubformname.form.filteron=true
you might put the code in the combo afterupdate event or perhaps the click event of a 'search now' button