I'm so frustrated with this pesky issue and I'd love it if someone could help me out.
I've got a query where I want some criteria to pass from a form's control. If the forms control is blank I want the query to pull all records. The field in question is a date field. I've tried all the examples below (and more) and none work correctly. Luckily, the query does seem to trigger the correct TRUE/FALSE instance; that is, I get the correct pull when there IS a value entered in the form, just not when the form is empty. When the forms control is empty the query just returns either zero results or a "You canceled the previous operation" error.
To be clear though, the FALSE condition DOES work when I try it without the IIF statement.
IIf([Forms]![- Primary]![rptCriteriaOptumSegmentIDs]<>"",[Forms]![- Primary]![rptCriteriaOptumSegmentIDs],">" & #1/1/1900#)
IIf([Forms]![- Primary]![rptCriteriaOptumSegmentIDs]<>"",[Forms]![- Primary]![rptCriteriaOptumSegmentIDs],"*")
IIf([Forms]![- Primary]![rptCriteriaOptumSegmentIDs]<>"",[Forms]![- Primary]![rptCriteriaOptumSegmentIDs],<=Now())
IIf([Forms]![- Primary]![rptCriteriaOptumSegmentIDs]<>"",[Forms]![- Primary]![rptCriteriaOptumSegmentIDs],([MembershipVarianceReport].[MembershipCountDate])<=Now())
Thanks in advance.
I've got a query where I want some criteria to pass from a form's control. If the forms control is blank I want the query to pull all records. The field in question is a date field. I've tried all the examples below (and more) and none work correctly. Luckily, the query does seem to trigger the correct TRUE/FALSE instance; that is, I get the correct pull when there IS a value entered in the form, just not when the form is empty. When the forms control is empty the query just returns either zero results or a "You canceled the previous operation" error.
To be clear though, the FALSE condition DOES work when I try it without the IIF statement.
IIf([Forms]![- Primary]![rptCriteriaOptumSegmentIDs]<>"",[Forms]![- Primary]![rptCriteriaOptumSegmentIDs],">" & #1/1/1900#)
IIf([Forms]![- Primary]![rptCriteriaOptumSegmentIDs]<>"",[Forms]![- Primary]![rptCriteriaOptumSegmentIDs],"*")
IIf([Forms]![- Primary]![rptCriteriaOptumSegmentIDs]<>"",[Forms]![- Primary]![rptCriteriaOptumSegmentIDs],<=Now())
IIf([Forms]![- Primary]![rptCriteriaOptumSegmentIDs]<>"",[Forms]![- Primary]![rptCriteriaOptumSegmentIDs],([MembershipVarianceReport].[MembershipCountDate])<=Now())
Thanks in advance.