Hi,
I have a list box on a form. I needed to filter records displayed on the list box depending on a separate combo box selection. I coded the SQL and filter in the VBA module of the form, and it works fine. As I become more familiar with Access and VBA, I am wondering if there was a simpler way to do this, using a query as the list box's record source (which I can do easily), and adding a dynamic filter onto that.
Is there a way to add a filter onto the recordsource query of a list box, as you can do with a form's filter? It seems so complicated to have all that code within VBA (I am concerned about upkeep by users).
Thanks in advance...
I have a list box on a form. I needed to filter records displayed on the list box depending on a separate combo box selection. I coded the SQL and filter in the VBA module of the form, and it works fine. As I become more familiar with Access and VBA, I am wondering if there was a simpler way to do this, using a query as the list box's record source (which I can do easily), and adding a dynamic filter onto that.
Is there a way to add a filter onto the recordsource query of a list box, as you can do with a form's filter? It seems so complicated to have all that code within VBA (I am concerned about upkeep by users).
Thanks in advance...