Last updated: August 28, 2026.
A query can read criteria from controls on an open form. This gives users date pickers, validation, and dropdowns instead of a sequence of plain parameter prompts.
Reference controls from the query
For a form named frmReportFilter with txtStartDate and txtEndDate controls, use fully qualified references.
PARAMETERS [Forms]![frmReportFilter]![txtStartDate] DateTime,
[Forms]![frmReportFilter]![txtEndDate] DateTime;
SELECT OrderID, CustomerID, OrderDate
FROM Orders
WHERE OrderDate >= [Forms]![frmReportFilter]![txtStartDate]
AND OrderDate < DateAdd("d", 1,
[Forms]![frmReportFilter]![txtEndDate])
ORDER BY OrderDate;Make a selection optional
Nz can turn a blank combo box into a wildcard criterion. This example returns every region when cboRegion is empty.
SELECT CustomerID, CompanyName, Region
FROM Customers
WHERE Region = [Forms]![frmReportFilter]![cboRegion]
OR [Forms]![frmReportFilter]![cboRegion] Is Null;Open the form first
The referenced form must be open when the query runs. Validate that the start date is not later than the end date before opening a report. Declare parameter types from Query Design so crosstab queries and report record sources resolve the controls correctly.
Reference: Microsoft parameter query guide.