T
Tom
Experts,
I have an option group on a form that uses values "1" and "2". Their (more
meaningful) labels are "Yes" (1) and "No" (2); the values are stored in
[tblIssues ].[WatchlistPAR].
Now, I have added an unbound combo box by which I want to filter for "All",
"Yes", and "No" records. I used the following SQL for the combo's
(filter) rowsource:
SELECT DISTINCT WatchlistPAR FROM tblIssues UNION SELECT "<All>" FROM
tblIssues;
Now, as you probably have already determined, my filter combo shows me
"All", "1", "2" (given the SQL above). Although the filter works (using
1, 2) fine for those 3 filter criteria (I get proper record count), I'm not
too happy with the values of "1" and "2". They don't mean anything to a
user.
Hence, I translated my SQL into the following:
SELECT DISTINCT IIf([WatchlistPAR]='1','Watchlist','Yes') AS WatchlistPARExp
FROM tblIssues UNION SELECT "<All>" FROM tblIssues;
While I now show "All", "Yes", "No" in my filter combo, I don't pull the
proper record count. Logically, "1" <> "Yes"... etc.
Below is the SQL for applying the filter:
DoCmd.ApplyFilter , "[WatchlistPAR] =
Forms![frmIssuesOpen]![cboWatchlistPAR]"
How do I modify the DoCmd.ApplyFilter so that "Yes" gives me all records =
"1" and "No" gives me those records = "2"?
I'd really appreciate any help on this.
Thanks,
EEH
BTW, I have added a hidden textbox that "translates" the "1" into "Yes" and
"2" into "No". I also modified my DoCmd.ApplyFilter to cross-reference
between the filter combo and the hidden textbox. I thought that this
solution maybe a work-around; however, it doesn't seem to match the records
either.
I have an option group on a form that uses values "1" and "2". Their (more
meaningful) labels are "Yes" (1) and "No" (2); the values are stored in
[tblIssues ].[WatchlistPAR].
Now, I have added an unbound combo box by which I want to filter for "All",
"Yes", and "No" records. I used the following SQL for the combo's
(filter) rowsource:
SELECT DISTINCT WatchlistPAR FROM tblIssues UNION SELECT "<All>" FROM
tblIssues;
Now, as you probably have already determined, my filter combo shows me
"All", "1", "2" (given the SQL above). Although the filter works (using
1, 2) fine for those 3 filter criteria (I get proper record count), I'm not
too happy with the values of "1" and "2". They don't mean anything to a
user.
Hence, I translated my SQL into the following:
SELECT DISTINCT IIf([WatchlistPAR]='1','Watchlist','Yes') AS WatchlistPARExp
FROM tblIssues UNION SELECT "<All>" FROM tblIssues;
While I now show "All", "Yes", "No" in my filter combo, I don't pull the
proper record count. Logically, "1" <> "Yes"... etc.
Below is the SQL for applying the filter:
DoCmd.ApplyFilter , "[WatchlistPAR] =
Forms![frmIssuesOpen]![cboWatchlistPAR]"
How do I modify the DoCmd.ApplyFilter so that "Yes" gives me all records =
"1" and "No" gives me those records = "2"?
I'd really appreciate any help on this.
Thanks,
EEH
BTW, I have added a hidden textbox that "translates" the "1" into "Yes" and
"2" into "No". I also modified my DoCmd.ApplyFilter to cross-reference
between the filter combo and the hidden textbox. I thought that this
solution maybe a work-around; however, it doesn't seem to match the records
either.