I have a form frmMergeData containing two unbound selector fields, SelectArea and SelectStatus, and want to pass their values to a query that is the source for an embedded subform.
Passing SelectArea, which is a text box, to the query's Area field works fine using the criterion
[Forms]![frmMergeData].[SelectArea]
The query's SQL is
SELECT tblExplorers.ExplorerArea, tblExplorers.ExplorerName, tblExplorers.Dormant
FROM tblExplorers
WHERE (((tblExplorers.ExplorerArea)=[Forms]![frmMergeData].[SelectArea]) AND ((tblExplorers.ExplorerSurname)>"0"))
ORDER BY tblExplorers.ExplorerArea;
The Dormant field is a checkbox and I'd like to pass the current SelectStatus value in the form to the query. I've set SelectStatus as a combo with values Yes or No but I can't get a criterion like below to work in the query
IIf([Forms]![frmMergeData].[SelectStatus]="No",0,-1)
Any thoughts?
Passing SelectArea, which is a text box, to the query's Area field works fine using the criterion
[Forms]![frmMergeData].[SelectArea]
The query's SQL is
SELECT tblExplorers.ExplorerArea, tblExplorers.ExplorerName, tblExplorers.Dormant
FROM tblExplorers
WHERE (((tblExplorers.ExplorerArea)=[Forms]![frmMergeData].[SelectArea]) AND ((tblExplorers.ExplorerSurname)>"0"))
ORDER BY tblExplorers.ExplorerArea;
The Dormant field is a checkbox and I'd like to pass the current SelectStatus value in the form to the query. I've set SelectStatus as a combo with values Yes or No but I can't get a criterion like below to work in the query
IIf([Forms]![frmMergeData].[SelectStatus]="No",0,-1)
Any thoughts?