database - How to create multiple connected search combo boxes to filter a form? -
i have form 10 columns, , 5 of them (project_phase, contract, design_dpm, amm/ucc, 1_or_2 stat) want add connected drop list combo boxes filter records , display data selected in combo boxes.
i know how make multiple drop list combo boxes filter whole form based on selection of 1 value 1 column. example, "contract" combo box has options: signed, not signed. if select "signed" display records have "signed". , if filter column cancel previous filter , display records relevant selection column.
but want ability filter using number of filtering options 5 columns mentioned. example, if want see records ("signed" under "contract") , in ("proposal" under "project_phase") , ("a dpm" under "design_dpm"). , after filtering want able clear filters , see records again, using form display records users. not want cascaded, might want filter using 1 column or more or all. , not want query or use basic filtering in datasheet view.
sorry lengthy explanation, if not clear explain further. thank efforts.
here 1 way implement form filter using multiple comboboxes.
- create table named 'tblwildcard'; 1 field named 'wildcard', save table.
- enter 1 record asterisk value
create queries comboboxes like:
select distinct table1.flda table1 order table1.flda union select wildcard tblwildcard
save query following sql row source form (i.e. qryforma):
select table1.flda, table1.fldb, table1.fldb table1 (((table1.flda) [forms]![frmform1]![cboflda]) , ((table1.fldb) [forms]![frmform1]![cbofldb]) , ((table1.fldc) [forms]![frmform1]![cbofldc]))
in after update event each combobox add following code:
me.recordsource = "qryforma"
sometimes 'me.rowsource.' may not work when changes made (weird issue!). if so, following:
application.echo false me.recordsource = vbnullstring me.recordsource = "rowvwfilter25" application.echo true
finally, if multi-user environment, , people may adding records need included in comboboxes, use combobox before update event , add following code:
me.cboflda.requery
Comments
Post a Comment