Hi, I have a form with FromDate and a ToDate boxes. These boxes will only appear when a dropdown (called "Status") on the form is set to "Paid". I have a query that needs to be able to restrict the query results between this date range if the dropdown is showing "Paid", otherwise show all results.
The query field is called [DatePaid] and here is the criteria I have against it:
IIF(forms!Payments.Status = "Paid",Between forms!Payments.FromDate and forms!Payments.ToDate,[DatePaid])
When the dropdown isn't showing "Paid" it displays all the results (ie last part of criteria works), when the dropdown is showing "Paid" and the dates are filled in I get no results in the query. Obviously the Between statement is having issues being part of the IIF statement and I've tried every syntax option I can think of (>= "# " etc). Can someone please tell me how this needs written to work.
Many thanks!
The query field is called [DatePaid] and here is the criteria I have against it:
IIF(forms!Payments.Status = "Paid",Between forms!Payments.FromDate and forms!Payments.ToDate,[DatePaid])
When the dropdown isn't showing "Paid" it displays all the results (ie last part of criteria works), when the dropdown is showing "Paid" and the dates are filled in I get no results in the query. Obviously the Between statement is having issues being part of the IIF statement and I've tried every syntax option I can think of (>= "# " etc). Can someone please tell me how this needs written to work.
Many thanks!