Currently I have a report created from a query with a filter based on a single unbound listbox which is working. I tried to add a second unbound listbox for additional filtering but it is not functioning - no errors just literally seems to do nothing. The code that does nothing is a replica of the posted working code with exception of the control names. Any suggestions would be appreciated. Thanks
Code:
'Private Sub listbox_AfterUpdate() ' If listbox= "ChoiceA" Then ' DoCmd.SetFilter WhereCondition:="[txtcontrolname] Like ""ChoiceA*""" ' ElseIf listbox= "ChoiceB" Then ' DoCmd.SetFilter WhereCondition:="[txtcontrolname] Like ""ChoiceB*""" ' ElseIf listbox= "ChoiceC" Then ' DoCmd.SetFilter WhereCondition:="[txtcontrolname] Like ""ChoiceC*""" ' ElseIf listbox= "ChoiceD" Then ' DoCmd.SetFilter WhereCondition:="[txtcontrolname] Like ""ChoiceD*""" ' Else ' DoCmd.SetFilter WhereCondition:="[txtcontrolname] Like ""*""" ' End If 'End Sub
Comment