I use a combo box to filter the results of a form.
Sql for combo box is...
SELECT StatusPriority, Status FROM tblStatus UNION Select = 0 as AllChoice,
"Show All" as Bogus From tblStatus ORDER BY StatusPriority;
AfterUpdate code from combo box is...
If Me![Status] = 0 Then
DoCmd.ShowAllRecords
Else
DoCmd.ApplyFilter , "[Status]='" & [StatusFilterCombo] & "'"
End If
All of the normal entries for the combo work fine in filtering the results
but when I select "Show All" no records show up. It is as though access
skips the If part of the statement and goes right to the then, finds no
records with "0" in [Status]
I tried using null values instead... UNION Select Null as AllChoice and If
IsNull (Me![Status]) Then and had the same results.
What am I doing wrong?