Hi everyone, I have searched and searched forums but so far have found nothing on this problem:
I have a search query that filters the search based on several fields from a form. The user chooses from combo boxes and whatever they choose goes in the query. The problem comes if the user chooses "All" in which case I don't want any criteria in the query (so as to show all results).
So I think I need an If...Then
If Forms!MyForm!MyField <> "Any" then Forms!MyForm!MyField
But it seems you can only use an "IIf" (not "If") statement in an expression, which requires a "DoIfFalse" argument. I don't want the query to filter anything at all if the form's field = "All" (result is false)
I looked at using SQL in VB but apparently this doesn't work on Select queries?
I have a search query that filters the search based on several fields from a form. The user chooses from combo boxes and whatever they choose goes in the query. The problem comes if the user chooses "All" in which case I don't want any criteria in the query (so as to show all results).
So I think I need an If...Then
If Forms!MyForm!MyField <> "Any" then Forms!MyForm!MyField
But it seems you can only use an "IIf" (not "If") statement in an expression, which requires a "DoIfFalse" argument. I don't want the query to filter anything at all if the form's field = "All" (result is false)
I looked at using SQL in VB but apparently this doesn't work on Select queries?