@aytee111
I've never used "All" as Ajax is suggesting, I am interested to hear how (s)he does it.
- I'm a he
when using a table as a rowsource. For a straight list you would use something like
Code:
SELECT fld1, 1 as SortOrder
FROM myTable
UNION SELECT "All", 0 FROM myTable
ORDER BY sortorder, fld1
or where there are ID's involved, something like
Code:
SELECT PK, fld1, 1 as SortOrder
FROM myTable
UNION SELECT 0, "All", 0 FROM myTable
ORDER BY sortorder, fld1
in which case your criteria would be
WHERE somefield = [Forms]![FormName]![ComboBoxName] OR [Forms]![FormName]![ComboBoxName] = 0
The dummy sortorder field is required to ensure that All appears at the top (or the bottom if you change it's value to 2 for the second union query), regardless of the sorting for the rest of the values (I presume you wouldn't want it to appear between Alaska and Arizona). It does not need to be referenced in the combo or listbox so the column count would remain unchanged.
Edit: just seen Paul's link, you can substitute a null for 0 in the second example
...
...
UNION SELECT Null, "All", 0 FROM myTable
...