ms access filter query with empty combobox
Posted on 2014-01-23
I have a query that i run from a command button on a form that exports the results to an excel spreadsheet. On the form I have a combobox (cboFacilityRefID) to filter the results of the query. This works fine when a value is selected in the combobox. However, if no value is selected the query returns no results. What i want to achieve is for all records to be returned when the combobox is empty.
I have tried the following but this doesnt seem to work
PS the FacilityRefID field in the underlying table in the query will always have a value in it (either 1,2, or 3 at the moment but will increase to 4,5 or 6 in time).