Trying to get query to work the way I want it to work

SteveL13
SteveL13 used Ask the Experts™
on
I have a form with three fields... a start date, an end date, and an employee combobox.  Then I have a query that has this syntax in the Date field:
Between [Forms]![frmTimeReportingHeader]![txtStartDate] And [Forms]![frmTimeReportingHeader]![txtEndDate]

Open in new window

But in the employee field I either want the record narrowed to the selection on the employee combobox.  This syntax works fine:
[Forms]![frmTimeReportingHeader]![cboEmployee]

Open in new window

But I cannot figure out what the employee syntax should be if I want all employees.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Top Expert 2016
Commented:
try changing this

[Forms]![frmTimeReportingHeader]![cboEmployee]


with

Nz([Forms]![frmTimeReportingHeader]![cboEmployee], [Employee])


try your query without selecting anything from the cboEmployee  combo box


.

Author

Commented:
Perfect!  Thank you very much.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial