问问题
7535 次
1 回答
1
一种非常简单的方法是将组合的绑定列设置为 *:
SELECT "*" As ID, "Select All" As AText
FROM Table1
UNION SELECT Table1.ID, Table1.AText
FROM Table1;
使用你的组合:
Select "*" As TreatmentID, "<<All Records>>" As Treatment
FROM Treatment
UNION
Select Treatment.TreatmentID, Treatment.Treatment
From Treatment;
然后,您可以使用 LIKE:
SELECT Table1.ID
FROM Table1
WHERE Table1.ID Like [forms]![MainForm]![Combo]
使用您的 SQL:
... WHERE (((Addresses.TreatmentID)
Like [Forms]![ReportCentre]![cboTreatmentType]) AND ...
如果您只有一列,则可以使用:
SELECT Table1.Atext
FROM Table1
WHERE AText Like
IIf(Forms![MainForm]!Combo="Select All","*",Forms![MainForm]!Combo)
于 2013-01-24T14:16:26.493 回答