In the where clause where you have the reference to the combo box control add an &"*" this will allow you to pass the wildcard for everything when nothing is selected but limit the list to what you select in the combo box otherwise.
You can check the value of the ComboBox and if it is null or "", [Nz(ComboBox1) = ""] then
change the WHERE clause to a value that is always True.
If Nz(ComboBox1) = "" Then
strSQLWhere = "[IDField]=" & IDField
Else
....
End If
The statement works with Like but then when a combo item is chosen it also includes anything that looks like this item. for eg. if the combo item chosen is 16 and we have say 167 in the table it displays result for both.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.