Filter a List box using a Combo Box (1 Viewer)

LHolden

Registered User.
Local time
Today, 01:25
Joined
Jul 18, 2012
Messages
73
Hi all-

I have a list box and a combo box on a form based on a query. The list box is a multi-select, with column values of Client, ClientEmail, and Medical.

Medical is a simple yes/no field, and it is what I want the combo box to help sort by. I have a Where clause in the query: WHERE (Medical=[forms]![frmOne]![cmbbx]), and the only values in the combo box are Yes and No (1 column). I also have the combo box set to run a requery macro after updating. I've also tried to change the macro to VBA:
Code:
 DoCmd.Requery "lstbx"

When I pick a string from the combo box, the list box just goes blank, rather than updating to clients who either do or don't have Medical, and I can't understand why.

If I forgot to put in any information you need, let me know and I'll respond ASAP.

Thanks for any help in advance :)
 

pr2-eugin

Super Moderator
Local time
Today, 06:25
Joined
Nov 30, 2011
Messages
8,494
You need the After Update event of the ComboBox where you set the criteria as,
Code:
Me.lstBx.Rowsource = "SELECT whatever FROM wherever WHERE something = '" & Me.comboBoxName & "'"
Me.lstBx.Requery
 

Users who are viewing this thread

Top Bottom