MS Access 2013 - Filter values in a list box, based on value in a Text box

user2308227 picture user2308227 · Apr 23, 2014 · Viewed 12.4k times · Source

I have made a form with a Listbox displaying a lot of names and addressees based on a query. How can I filter the names in the form, based on a Text box in the same form?

(Not all the names are relevant for every record)

Answer

SEM_jmc picture SEM_jmc · Apr 23, 2014

The listbox has a RowSource, so you can modify it on the fly:

Me!Listbox.RowSource = "SELECT .... FROM .... WHERE ..."
Me!Listbox.Requery

to modify the SQL with the value in the Textbox, use the Textbox AfterUpdate event