I currently have a listbox that displays all the items in a table. It includes a couple queries to other tables as well; it works fine. The SQL is:
Code:
SELECT Items.ID, Items.QBItemNumber, MFGList.MFG, Items.Model, Items.ModelNumber, Items.HasUniqueID, Items.IsPhysical, Categories.Category, Categories.SubCategory
FROM MFGList INNER JOIN (Categories INNER JOIN Items ON Categories.ID = Items.Category) ON MFGList.ID = Items.Manufacturer;
I would like a listbox that displays all the items in a table... filtered against some text boxes and comboboxes.
The problem is that when I add criteria (for example, I add the criteria "txtFilterItemNumber.Value" to the Items.ID field), the listbox is empty if the filter is blank. I really only want the filter applied if it has something in it.
So then I tried added an "OR" statement. Here's the SQL for just one field:
Code:
SELECT Items.ID
FROM Items
WHERE ID=[txtFilterItemNumber].[Value] OR [txtFilterItemNumber].[Value]="";
Still doesn't work--AND when I apply it all the fields, a million criteria appear in design view and Access crashes.
I assume this has done before; what am I doing wrong?
Dan