G
Guest
I have a form where users input various query criteria. I have one field in particluar wher a user might want to search a field for a certain text string that they have entered in a text box. However, I also want to offer the user the inverse option i.e. to return records where the field doesn't contain the search text. I wanted to use a check box on the form for users to indicate what their preference is i.e. matching records or not matching records
I then tried to use the following expression in the criteria of the search field ([tblProperties].[county]) in the query:
IIF([Forms]![frmAvailability]![chkNotLikeCounty]=Yes,
[tblProperties].[county] Not Like "**" & [Forms]![frmAvailability]![txtCounty] & "**",
[tblProperties].[county] Like "**" & [Forms]![frmAvailability]![txtCounty] & "**")
However, I'm getting an error message. Can anybody suggest why?
I then tried to use the following expression in the criteria of the search field ([tblProperties].[county]) in the query:
IIF([Forms]![frmAvailability]![chkNotLikeCounty]=Yes,
[tblProperties].[county] Not Like "**" & [Forms]![frmAvailability]![txtCounty] & "**",
[tblProperties].[county] Like "**" & [Forms]![frmAvailability]![txtCounty] & "**")
However, I'm getting an error message. Can anybody suggest why?