In a form, I have an unbound textbox (TEXT1) with an option button next to it (OPTION1). In a query, I have the field, LAST NAME. The criteria for LAST NAME is linked to TEXT1 in the form:
[Forms]![frm_MAIN]![TEXT1]
But, if the person highlights the option button, I want the criteria to acknowledge that as a partial search:
Like "*" & [Forms]![frm_MAIN]![TEXT1] & "*"
So I wrote my criteria as such:
IIF([Forms]![frm_MAIN]![OPTION1].Value = -1, Like "*" & [Forms]![frm_MAIN]![TEXT1] & "*", [Forms]![frm_MAIN]![TEXT1])
If I leave the option button unchecked, it works, but if it's checked (-1), it returns zero records. It should at least return the same amount of records. Any suggestions?
Thank you!
[Forms]![frm_MAIN]![TEXT1]
But, if the person highlights the option button, I want the criteria to acknowledge that as a partial search:
Like "*" & [Forms]![frm_MAIN]![TEXT1] & "*"
So I wrote my criteria as such:
IIF([Forms]![frm_MAIN]![OPTION1].Value = -1, Like "*" & [Forms]![frm_MAIN]![TEXT1] & "*", [Forms]![frm_MAIN]![TEXT1])
If I leave the option button unchecked, it works, but if it's checked (-1), it returns zero records. It should at least return the same amount of records. Any suggestions?
Thank you!