All -
I have a query in which I want to look at a form, and match against 1
value if a specific value has been selected from a list box, or another
value if it has not. I'll have similar criteria in several columns,
checking to see if a specific column should be searched.
In english, my logic goes like this:
If(ListBoxSelection="Name", then Use ListBoxSelection As Criteria, else
Use Other Criteria)
I have this working for exact text matches:
IIf([Forms]![Main]![llb_SearchMe]="Name",([Forms]![main]![tb_Search]),([Forms]![main]![lb_Data_Model]))
But of course, I want to do the search for "near matches," using "Like"
to do the job. Elsewhere, I have no problem using Like, which I have
constructed so:
Like "*" & ([Forms]![main]![tb_Search]) & "*"
But no matter how I add "Like" to my Iif statement, I get no results.
I get no error, but I get no results.
I've tried...and tried...and tried...and tried...
IIf([Forms]![Main]![llb_SearchMe]="Name",(Like "*" &
([Forms]![main]![tb_Search]) & "*"),([Forms]![main]![lb_Data_Model]))
IIf([Forms]![Main]![llb_SearchMe]="Name",(Like "*" &
[Forms]![main]![tb_Search] & "*"),([Forms]![main]![lb_Data_Model]))
IIf([Forms]![Main]![llb_SearchMe]="Name",Like "*" &
([Forms]![main]![tb_Search]) & "*",([Forms]![main]![lb_Data_Model]))
IIf([Forms]![Main]![llb_SearchMe]="Name",Like "*" &
[Forms]![main]![tb_Search] & "*",([Forms]![main]![lb_Data_Model]))
IIf([Forms]![Main]![llb_SearchMe]="Name",Like "*" &
"[Forms]![main]![tb_Search]" & "*",([Forms]![main]![lb_Data_Model]))
Any Ideas?
Patrick