Hey everyone. I have a subform that is based off a query, so I can perform a "keyword" search. The criteria in the query for that particular field is:
Like "*" & [forms]![SEARCHfrmGlossary].[txtKeywordSearch] & "*"
When I run that form by itself, it's fine. But when I add that form as a subform, and run it, it's asking for a value for the [forms]![SEARCHfrmGlossary].[txtKeywordSearch].
I'm thinking it has something to do with how the query is written (might have to add more to the above code), but I'm lost as to how to do it. Basically, if the "keyword" search field is blank or null on the SUBFORM (SEARCHfrmGlossary), then return all records, otherwise, only return the "like" function.
I was thinking along the lines of adding this to the query in the criteria:
iif([forms]![SEARCHfrmGlossary].[txtKeywordSearch] is null or "", [alldefinitions], Like "*" & [forms]![SEARCHfrmGlossary].[txtKeywordSearch] & "*")
But, it still asks for the parameter value of : [forms]![SEARCHfrmGlossary].[txtKeywordSearch] .
What am I doing wrong?
thanks.
Like "*" & [forms]![SEARCHfrmGlossary].[txtKeywordSearch] & "*"
When I run that form by itself, it's fine. But when I add that form as a subform, and run it, it's asking for a value for the [forms]![SEARCHfrmGlossary].[txtKeywordSearch].
I'm thinking it has something to do with how the query is written (might have to add more to the above code), but I'm lost as to how to do it. Basically, if the "keyword" search field is blank or null on the SUBFORM (SEARCHfrmGlossary), then return all records, otherwise, only return the "like" function.
I was thinking along the lines of adding this to the query in the criteria:
iif([forms]![SEARCHfrmGlossary].[txtKeywordSearch] is null or "", [alldefinitions], Like "*" & [forms]![SEARCHfrmGlossary].[txtKeywordSearch] & "*")
But, it still asks for the parameter value of : [forms]![SEARCHfrmGlossary].[txtKeywordSearch] .
What am I doing wrong?
thanks.