Not sure why the following query failed:
Select FieldA from TableA where (TableA.FieldA = IIf([Forms]![frmFormA]![ComboA]<> "ALL", [Forms]![frmFormA]![ComboA], ([TableA].[FieldA] like "*"))
This query gets created dynamically in Forms.frmFormA based on FieldA's comboBox selection with selection items: (All, Item1, Item2... etc).
I need the query to do the following:
If user selected All, then all records in FieldA will be selected else only the selected item records are selected.
In my test, this query will work if an item is selected but not 'ALL' which will return an empty recordset.
I tested the (LIKE "*") syntax using the following qurey and it works:
Select FieldA from TableA where ([TableA].[FieldA] like "*").
Any insight or suggestion is appreciated.
Select FieldA from TableA where (TableA.FieldA = IIf([Forms]![frmFormA]![ComboA]<> "ALL", [Forms]![frmFormA]![ComboA], ([TableA].[FieldA] like "*"))
This query gets created dynamically in Forms.frmFormA based on FieldA's comboBox selection with selection items: (All, Item1, Item2... etc).
I need the query to do the following:
If user selected All, then all records in FieldA will be selected else only the selected item records are selected.
In my test, this query will work if an item is selected but not 'ALL' which will return an empty recordset.
I tested the (LIKE "*") syntax using the following qurey and it works:
Select FieldA from TableA where ([TableA].[FieldA] like "*").
Any insight or suggestion is appreciated.