Howdy accessians -
I have 2 text boxes on my main navigation page - first box selects a country - and the second box selects a report from that country.
The second box has a query that is dependant on something being selected in the first box
everything is currently working fine - but what I would like to do is be able to show and select from ALLthe reports in the second box if there is nothing selected in the country box.
ie*if txtboxA is null, SELECT * from tbl, else SELECT * WHERE agentID = forms!frmnavigation!masterfilter
Obviously if I remove the WHERE i get exactly what i need...
is there some way to do a conditional WHERE?
ie, can i use IIF in the criteria secion of the query builder?
I have a feeling that I'm missing something fundamental.

I have 2 text boxes on my main navigation page - first box selects a country - and the second box selects a report from that country.
The second box has a query that is dependant on something being selected in the first box
everything is currently working fine - but what I would like to do is be able to show and select from ALLthe reports in the second box if there is nothing selected in the country box.
ie*if txtboxA is null, SELECT * from tbl, else SELECT * WHERE agentID = forms!frmnavigation!masterfilter
Code:
SELECT tblReports.ReportID, tblAgency.AgencyName, tblReports.PeriodType, tblReports.PeriodEnded, tblReports.Completed
FROM tblAgency INNER JOIN tblReports ON tblAgency.AgencyID = tblReports.AgencyID
WHERE (((tblReports.AgencyID)=[forms]![frmnavigation]![masterfilter]))
ORDER BY tblReports.ReportID DESC;
is there some way to do a conditional WHERE?
ie, can i use IIF in the criteria secion of the query builder?
I have a feeling that I'm missing something fundamental.
