I have a query that runs based on selection from a form. My form has 2 fields [txtStart] and [txtEnd]. I want my query to return all records if those 2 fields are left null. But if the user enters a date into both I want the query to return records where the field [CompletedDate] is between [txtStart] and [txtEnd]. I can't seem to get the query right. Here's what I have in my query grid: I select all fields and the following expression field
Code:
Expr1: [CompletedDate] Between [Forms]![frm_FilterForm]![txtStart] And [Forms]![frm_FilterForm]![txtEnd] Or [Forms]![frm_FilterForm]![txtStart] Is Null And [Forms]![frm_FilterForm]![txtEnd] Is Null