Umair Ansari
Umair Ansari

Reputation: 418

MS-Access error: At most one record can be returned by this subquery

When I am trying to run this query it gives me error "At most one record can be returned by this subquery"

SELECT * from rosterTbl 
WHERE 
rosterTbl.CounsellorID IN (IIF (ISNULL([Forms]![ReportsGUI]![cmbCounsellor]) , (SELECT counsellorID FROM
[Main: Counsellors_Tbl]),[Forms]![ReportsGUI]![cmbCounsellor]))

Upvotes: 2

Views: 1710

Answers (1)

Robert Harvey
Robert Harvey

Reputation: 180788

For what you're trying to accomplish, your query should look something like this:

SELECT * from rosterTbl 
WHERE [Forms]![ReportsGUI]![cmbCounsellor] IS NULL
OR rosterTbl.CounsellorID 
IN (SELECT counsellorID FROM [Main: Counsellors_Tbl])

Upvotes: 2

Related Questions